﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.InteropServices;
using System.Data;
using System.Reflection;

namespace RTUParameterConfig.Class
{
    public class Protocol
    {
        /// <summary>
		/// 结构体转byte数组
		/// </summary>
		/// <param name="structObj">结构体</param>
		/// <returns>byte数组</returns>
		public static byte[] StructToBytes(object structObj)
        {
            //结构体的大小
            int size = Marshal.SizeOf(structObj);
            //创建byte数组
            byte[] bytes = new byte[size];
            //分配结构体大小的内存空间
            IntPtr structPtr = Marshal.AllocHGlobal(size);
            //将结构体拷到分配好的内存空间
            Marshal.StructureToPtr(structObj, structPtr, false);
            //从内存空间拷到byte数组
            Marshal.Copy(structPtr, bytes, 0, size);
            //释放内存空间
            Marshal.FreeHGlobal(structPtr);
            return bytes;
        }

        /// <summary>
        /// byte数组转结构体
        /// </summary>
        /// <param name="bytes">byte数组</param>
        /// <param name="type">结构体类型</param>
        /// <returns>转换后的结构体</returns>
        public static object BytesToStuct(byte[] bytes, Type type)
        {
            //结构体的大小
            int size = Marshal.SizeOf(type);
            //byte数组长度小于结构体的大小
            if (size > bytes.Length)
            {
                return null;
            }
            //分配结构体大小的内存空间
            IntPtr structPtr = Marshal.AllocHGlobal(size);
            //将byte数组拷到分配好的内存空间
            Marshal.Copy(bytes, 0, structPtr, size);
            //将内存空间转换为目标结构体
            object obj = Marshal.PtrToStructure(structPtr, type);
            //释放内存空间
            Marshal.FreeHGlobal(structPtr);
            return obj;
        }



        public static string ConvertData(Byte[] data)
        {
            try
            {
                StringBuilder sb = new StringBuilder();
                foreach (Byte b in data)
                {
                    sb.Append(Convert.ToString(b, 16).PadLeft(2, '0'));
                }
                return sb.ToString();
            }
            catch { return string.Empty; }
        }

        /// <summary>
        /// 16进制原码字符串转字节数组
        /// </summary>
        /// <param name="hexString">"AABBCC"或"AA BB CC"格式的字符串</param>
        /// <returns></returns>
        public static byte[] ConvertHexStringToBytes(string hexString)
        {
            hexString = hexString.Replace(" ", "");
            if (hexString.Length % 2 != 0)
            {
                throw new ArgumentException("参数长度不正确");
            }

            byte[] returnBytes = new byte[hexString.Length / 2];
            for (int i = 0; i < returnBytes.Length; i++)
            {
                returnBytes[i] = Convert.ToByte(hexString.Substring(i * 2, 2), 16);
            }

            return returnBytes;
        }

        /// <summary>
        /// 检查设备配置参数修改
        /// </summary>
        /// <param name="r1">修改前结构体</param>
        /// <param name="r2">修改后结构体</param>
        /// <returns>修改内容</returns>
        public static string CheckUpdateData(RTUParameterConfig.Class.StructData.RtuConfigInfo r1, RTUParameterConfig.Class.StructData.RtuConfigInfo r2)
        {
            StringBuilder sb = new StringBuilder();
            if (r1.StationType != r2.StationType)
            {
                sb.Append(string.Format("遥测站类型: {0}改为{1}\r\n", Common.StationType[r1.StationType], Common.StationType[r2.StationType]));
            }

            string str1 = Protocol.ConvertData(r1.StationNo);
            string str2 = Protocol.ConvertData(r2.StationNo);
            if (str1 != str2)
            {
                sb.Append(string.Format("遥测站编码: {0}改为{1}\r\n", str1, str2));
            }

            str1 = System.Text.Encoding.Default.GetString(r1.StationName).Replace("\0", "");
            str2 = System.Text.Encoding.Default.GetString(r2.StationName).Replace("\0", "");
            if (str1 != str2)
            {
                sb.Append(string.Format("遥测站名称: {0}改为{1}\r\n", str1, str2));
            }

            if (r1.ReportingCycle != r2.ReportingCycle)
            {
                sb.Append(string.Format("加报周期: {0}改为{1}\r\n", r1.ReportingCycle, r2.ReportingCycle));
            }

            if (r1.DataSaveCycel != r2.DataSaveCycel)
            {
                sb.Append(string.Format("存储周期: {0}改为{1}\r\n", r1.DataSaveCycel, r2.DataSaveCycel));
            }

            if (r1.HeartbeatCycel != r2.HeartbeatCycel)
            {
                sb.Append(string.Format("链路维持报周期: {0}改为{1}\r\n", r1.HeartbeatCycel, r2.HeartbeatCycel));
            }

            if (r1.WorkMode != r2.WorkMode)
            {
                sb.Append(string.Format("工作模式: {0}改为{1}\r\n", Common.WorkType[r1.WorkMode], Common.WorkType[r2.WorkMode]));
            }

            if (r1.TimingReport != r2.TimingReport)
            {
                sb.Append(string.Format("定时报周期: {0}改为{1}\r\n", r1.TimingReport, r2.TimingReport));
            }

            if (r1.HourReport != r2.HourReport)
            {
                sb.Append(string.Format("小时报: {0}改为{1}\r\n", Common.OpenStatus[r1.HourReport], Common.OpenStatus[r2.HourReport]));
            }

            if (r1.AlarmCount != r2.AlarmCount)
            {
                sb.Append(string.Format("报警加报次数: {0}改为{1}\r\n", r1.AlarmCount, r2.AlarmCount));
            }

            if (r1.AutoTiming != r2.AutoTiming)
            {
                sb.Append(string.Format("小时报: {0}改为{1}\r\n", Common.OpenStatus[r1.AutoTiming], Common.OpenStatus[r2.AutoTiming]));
            }

            if (r1.EthernetStatus != r2.EthernetStatus)
            {
                sb.Append(string.Format("以太网: {0}改为{1}\r\n", Common.OpenStatus[r1.EthernetStatus], Common.OpenStatus[r2.EthernetStatus]));
            }

            if (r1.EthernetDHCP != r2.EthernetDHCP)
            {
                sb.Append(string.Format("自动DHCP: {0}改为{1}\r\n", Common.OpenStatus[r1.EthernetDHCP], Common.OpenStatus[r2.EthernetDHCP]));
            }

            str1 = r1.EthernetIP[0].ToString() + "." + r1.EthernetIP[1].ToString() + "." + r1.EthernetIP[2].ToString() + "." + r1.EthernetIP[3].ToString();
            str2 = r2.EthernetIP[0].ToString() + "." + r2.EthernetIP[1].ToString() + "." + r2.EthernetIP[2].ToString() + "." + r2.EthernetIP[3].ToString();
            if (str1 != str2)
            {
                sb.Append(string.Format("以太网IP地址: {0}改为{1}\r\n", str1, str2));
            }

            str1 = r1.EthernetGateway[0].ToString() + "." + r1.EthernetGateway[1].ToString() + "." + r1.EthernetGateway[2].ToString() + "." + r1.EthernetGateway[3].ToString();
            str2 = r2.EthernetGateway[0].ToString() + "." + r2.EthernetGateway[1].ToString() + "." + r2.EthernetGateway[2].ToString() + "." + r2.EthernetGateway[3].ToString();
            if (str1 != str2)
            {
                sb.Append(string.Format("以太网网关: {0}改为{1}\r\n", str1, str2));
            }

            str1 = r1.EthernetNetmask[0].ToString() + "." + r1.EthernetNetmask[1].ToString() + "." + r1.EthernetNetmask[2].ToString() + "." + r1.EthernetNetmask[3].ToString();
            str2 = r2.EthernetNetmask[0].ToString() + "." + r2.EthernetNetmask[1].ToString() + "." + r2.EthernetNetmask[2].ToString() + "." + r2.EthernetNetmask[3].ToString();
            if (str1 != str2)
            {
                sb.Append(string.Format("以太网子网掩码: {0}改为{1}\r\n", str1, str2));
            }

            str1 = r1.EthernetDNS[0].ToString() + "." + r1.EthernetDNS[1].ToString() + "." + r1.EthernetDNS[2].ToString() + "." + r1.EthernetDNS[3].ToString();
            str2 = r2.EthernetDNS[0].ToString() + "." + r2.EthernetDNS[1].ToString() + "." + r2.EthernetDNS[2].ToString() + "." + r2.EthernetDNS[3].ToString();
            if (str1 != str2)
            {
                sb.Append(string.Format("以太网主DNS: {0}改为{1}\r\n", str1, str2));
            }

            str1 = r1.EthernetBackupDNS[0].ToString() + "." + r1.EthernetBackupDNS[1].ToString() + "." + r1.EthernetBackupDNS[2].ToString() + "." + r1.EthernetBackupDNS[3].ToString();
            str2 = r2.EthernetBackupDNS[0].ToString() + "." + r2.EthernetBackupDNS[1].ToString() + "." + r2.EthernetBackupDNS[2].ToString() + "." + r2.EthernetBackupDNS[3].ToString();
            if (str1 != str2)
            {
                sb.Append(string.Format("以太网备用DNS: {0}改为{1}\r\n", str1, str2));
            }
           
            if (r1.EthernetResetTime != r2.EthernetResetTime)
            {
                sb.Append(string.Format("以太网强制重连: {0}改为{1}\r\n", r1.EthernetResetTime, r2.EthernetResetTime));
            }

            str1 = r1.CentralStationIP1[0].ToString() + "." + r1.CentralStationIP1[1].ToString() + "." + r1.CentralStationIP1[2].ToString() + "." + r1.CentralStationIP1[3].ToString();
            str2 = r2.CentralStationIP1[0].ToString() + "." + r2.CentralStationIP1[1].ToString() + "." + r2.CentralStationIP1[2].ToString() + "." + r2.CentralStationIP1[3].ToString();
            if (str1 != str2)
            {
                sb.Append(string.Format("中心站1IP地址: {0}改为{1}\r\n", str1, str2));
            }

            str1 = Common.BytesToShort(r1.CentralStationPort1[0], r1.CentralStationPort1[1]).ToString();
            str2 = Common.BytesToShort(r2.CentralStationPort1[0], r2.CentralStationPort1[1]).ToString();
            if (str1 != str2)
            {
                sb.Append(string.Format("中心站1端口: {0}改为{1}\r\n", str1, str2));
            }

            str1 = Common.BytesToShort(r1.CentralStationBackupPort1[0], r1.CentralStationBackupPort1[1]).ToString();
            str2 = Common.BytesToShort(r2.CentralStationBackupPort1[0], r2.CentralStationBackupPort1[1]).ToString();
            if (str1 != str2)
            {
                sb.Append(string.Format("中心站1备用端口: {0}改为{1}\r\n", str1, str2));
            }

            str1 = r1.CentralStationAddr[0].ToString();
            str2 = r2.CentralStationAddr[0].ToString();
            if (str1 != str2)
            {
                sb.Append(string.Format("中心站1地址编码: {0}改为{1}\r\n", str1, str2));
            }

            str1 = Common.BytesToShort(r1.CentralStationPassward1[0], r1.CentralStationPassward1[1]).ToString();
            str2 = Common.BytesToShort(r2.CentralStationPassward1[0], r2.CentralStationPassward1[1]).ToString();
            if (str1 != str2)
            {
                sb.Append(string.Format("中心站1密码: {0}改为{1}\r\n", str1, str2));
            }

            str1 = new string(r1.CentralStationPhone1).Replace("\0","");
            str2 = new string(r2.CentralStationPhone1).Replace("\0", "");
            if (str1 != str2)
            {
                sb.Append(string.Format("中心站1电话号码: {0}改为{1}\r\n", str1, str2));
            }

            if (r1.CentralStationTransportProtocol[0] != r2.CentralStationTransportProtocol[0])
            {
                sb.Append(string.Format("中心站1传输协议: {0}改为{1}\r\n", Common.TransportProtocol[r1.CentralStationTransportProtocol[0]], Common.TransportProtocol[r2.CentralStationTransportProtocol[0]]));
            }

            if (r1.CentralStationReportProtocol[0] != r2.CentralStationReportProtocol[0])
            {
                sb.Append(string.Format("中心站1报文协议: {0}改为{1}\r\n", Common.ReportProtocol[r1.CentralStationReportProtocol[0]], Common.ReportProtocol[r2.CentralStationReportProtocol[0]]));
            }

            if (r1.CentralStationHardwareInterface[0] != r2.CentralStationHardwareInterface[0])
            {
                sb.Append(string.Format("中心站1硬件接口: {0}改为{1}\r\n", Common.HardwareInterface[r1.CentralStationHardwareInterface[0]], Common.HardwareInterface[r2.CentralStationHardwareInterface[0]]));
            }

            str1 = r1.CentralStationIP2[0].ToString() + "." + r1.CentralStationIP2[1].ToString() + "." + r1.CentralStationIP2[2].ToString() + "." + r1.CentralStationIP2[3].ToString();
            str2 = r2.CentralStationIP2[0].ToString() + "." + r2.CentralStationIP2[1].ToString() + "." + r2.CentralStationIP2[2].ToString() + "." + r2.CentralStationIP2[3].ToString();
            if (str1 != str2)
            {
                sb.Append(string.Format("中心站2IP地址: {0}改为{1}\r\n", str1, str2));
            }

            str1 = Common.BytesToShort(r1.CentralStationPort2[0], r1.CentralStationPort2[1]).ToString();
            str2 = Common.BytesToShort(r2.CentralStationPort2[0], r2.CentralStationPort2[1]).ToString();
            if (str1 != str2)
            {
                sb.Append(string.Format("中心站2端口: {0}改为{1}\r\n", str1, str2));
            }

            str1 = Common.BytesToShort(r1.CentralStationBackupPort2[0], r1.CentralStationBackupPort2[1]).ToString();
            str2 = Common.BytesToShort(r2.CentralStationBackupPort2[0], r2.CentralStationBackupPort2[1]).ToString();
            if (str1 != str2)
            {
                sb.Append(string.Format("中心站2备用端口: {0}改为{1}\r\n", str1, str2));
            }

            str1 = r1.CentralStationAddr[1].ToString();
            str2 = r2.CentralStationAddr[1].ToString();
            if (str1 != str2)
            {
                sb.Append(string.Format("中心站2地址编码: {0}改为{1}\r\n", str1, str2));
            }

            str1 = Common.BytesToShort(r1.CentralStationPassward2[0], r1.CentralStationPassward2[1]).ToString();
            str2 = Common.BytesToShort(r2.CentralStationPassward2[0], r2.CentralStationPassward2[1]).ToString();
            if (str1 != str2)
            {
                sb.Append(string.Format("中心站2密码: {0}改为{1}\r\n", str1, str2));
            }

            str1 = new string(r1.CentralStationPhone2).Replace("\0", "");
            str2 = new string(r2.CentralStationPhone2).Replace("\0", "");
            if (str1 != str2)
            {
                sb.Append(string.Format("中心站2电话号码: {0}改为{1}\r\n", str1, str2));
            }

            if (r1.CentralStationTransportProtocol[1] != r2.CentralStationTransportProtocol[1])
            {
                sb.Append(string.Format("中心站2传输协议: {0}改为{1}\r\n", Common.TransportProtocol[r1.CentralStationTransportProtocol[1]], Common.TransportProtocol[r2.CentralStationTransportProtocol[1]]));
            }

            if (r1.CentralStationReportProtocol[1] != r2.CentralStationReportProtocol[1])
            {
                sb.Append(string.Format("中心站2报文协议: {0}改为{1}\r\n", Common.ReportProtocol[r1.CentralStationReportProtocol[1]], Common.ReportProtocol[r2.CentralStationReportProtocol[1]]));
            }

            if (r1.CentralStationHardwareInterface[1] != r2.CentralStationHardwareInterface[1])
            {
                sb.Append(string.Format("中心站2硬件接口: {0}改为{1}\r\n", Common.HardwareInterface[r1.CentralStationHardwareInterface[1]], Common.HardwareInterface[r2.CentralStationHardwareInterface[1]]));
            }

            str1 = r1.CentralStationIP3[0].ToString() + "." + r1.CentralStationIP3[1].ToString() + "." + r1.CentralStationIP3[2].ToString() + "." + r1.CentralStationIP3[3].ToString();
            str2 = r2.CentralStationIP3[0].ToString() + "." + r2.CentralStationIP3[1].ToString() + "." + r2.CentralStationIP3[2].ToString() + "." + r2.CentralStationIP3[3].ToString();
            if (str1 != str2)
            {
                sb.Append(string.Format("中心站3IP地址: {0}改为{1}\r\n", str1, str2));
            }

            str1 = Common.BytesToShort(r1.CentralStationPort3[0], r1.CentralStationPort3[1]).ToString();
            str2 = Common.BytesToShort(r2.CentralStationPort3[0], r2.CentralStationPort3[1]).ToString();
            if (str1 != str2)
            {
                sb.Append(string.Format("中心站3端口: {0}改为{1}\r\n", str1, str2));
            }

            str1 = Common.BytesToShort(r1.CentralStationBackupPort3[0], r1.CentralStationBackupPort3[1]).ToString();
            str2 = Common.BytesToShort(r2.CentralStationBackupPort3[0], r2.CentralStationBackupPort3[1]).ToString();
            if (str1 != str2)
            {
                sb.Append(string.Format("中心站3备用端口: {0}改为{1}\r\n", str1, str2));
            }

            str1 = r1.CentralStationAddr[2].ToString();
            str2 = r2.CentralStationAddr[2].ToString();
            if (str1 != str2)
            {
                sb.Append(string.Format("中心站3地址编码: {0}改为{1}\r\n", str1, str2));
            }

            str1 = Common.BytesToShort(r1.CentralStationPassward3[0], r1.CentralStationPassward3[1]).ToString();
            str2 = Common.BytesToShort(r2.CentralStationPassward3[0], r2.CentralStationPassward3[1]).ToString();
            if (str1 != str2)
            {
                sb.Append(string.Format("中心站3密码: {0}改为{1}\r\n", str1, str2));
            }

            str1 = new string(r1.CentralStationPhone3).Replace("\0", "");
            str2 = new string(r2.CentralStationPhone3).Replace("\0", "");
            if (str1 != str2)
            {
                sb.Append(string.Format("中心站3电话号码: {0}改为{1}\r\n", str1, str2));
            }

            if (r1.CentralStationTransportProtocol[2] != r2.CentralStationTransportProtocol[2])
            {
                sb.Append(string.Format("中心站3传输协议: {0}改为{1}\r\n", Common.TransportProtocol[r1.CentralStationTransportProtocol[2]], Common.TransportProtocol[r2.CentralStationTransportProtocol[2]]));
            }

            if (r1.CentralStationReportProtocol[2] != r2.CentralStationReportProtocol[2])
            {
                sb.Append(string.Format("中心站3报文协议: {0}改为{1}\r\n", Common.ReportProtocol[r1.CentralStationReportProtocol[2]], Common.ReportProtocol[r2.CentralStationReportProtocol[2]]));
            }

            if (r1.CentralStationHardwareInterface[2] != r2.CentralStationHardwareInterface[2])
            {
                sb.Append(string.Format("中心站3硬件接口: {0}改为{1}\r\n", Common.HardwareInterface[r1.CentralStationHardwareInterface[2]], Common.HardwareInterface[r2.CentralStationHardwareInterface[2]]));
            }

            str1 = r1.CentralStationIP4[0].ToString() + "." + r1.CentralStationIP4[1].ToString() + "." + r1.CentralStationIP4[2].ToString() + "." + r1.CentralStationIP4[3].ToString();
            str2 = r2.CentralStationIP4[0].ToString() + "." + r2.CentralStationIP4[1].ToString() + "." + r2.CentralStationIP4[2].ToString() + "." + r2.CentralStationIP4[3].ToString();
            if (str1 != str2)
            {
                sb.Append(string.Format("中心站4IP地址: {0}改为{1}\r\n", str1, str2));
            }

            str1 = Common.BytesToShort(r1.CentralStationPort4[0], r1.CentralStationPort4[1]).ToString();
            str2 = Common.BytesToShort(r2.CentralStationPort4[0], r2.CentralStationPort4[1]).ToString();
            if (str1 != str2)
            {
                sb.Append(string.Format("中心站4端口: {0}改为{1}\r\n", str1, str2));
            }

            str1 = Common.BytesToShort(r1.CentralStationBackupPort4[0], r1.CentralStationBackupPort4[1]).ToString();
            str2 = Common.BytesToShort(r2.CentralStationBackupPort4[0], r2.CentralStationBackupPort4[1]).ToString();
            if (str1 != str2)
            {
                sb.Append(string.Format("中心站4备用端口: {0}改为{1}\r\n", str1, str2));
            }

            str1 = r1.CentralStationAddr[3].ToString();
            str2 = r2.CentralStationAddr[3].ToString();
            if (str1 != str2)
            {
                sb.Append(string.Format("中心站4地址编码: {0}改为{1}\r\n", str1, str2));
            }

            str1 = Common.BytesToShort(r1.CentralStationPassward4[0], r1.CentralStationPassward4[1]).ToString();
            str2 = Common.BytesToShort(r2.CentralStationPassward4[0], r2.CentralStationPassward4[1]).ToString();
            if (str1 != str2)
            {
                sb.Append(string.Format("中心站4密码: {0}改为{1}\r\n", str1, str2));
            }

            if (r1.CentralStationVpnEnable != r2.CentralStationVpnEnable)
            {
                sb.Append(string.Format("中心站VPN专网设置中心站专网接入: {0}改为{1}\r\n", Common.OpenStatus[r1.CentralStationVpnEnable], Common.OpenStatus[r2.CentralStationVpnEnable]));
            }

            str1 = new string(r1.CentralStationVpnPoint).Replace("\0", "");
            str2 = new string(r2.CentralStationVpnPoint).Replace("\0", "");
            if (str1 != str2)
            {
                sb.Append(string.Format("中心站VPN专网设置接入点: {0}改为{1}\r\n", str1, str2));
            }

            str1 = new string(r1.CentralStationVpnName).Replace("\0", "");
            str2 = new string(r2.CentralStationVpnName).Replace("\0", "");
            if (str1 != str2)
            {
                sb.Append(string.Format("中心站VPN专网设置用户名: {0}改为{1}\r\n", str1, str2));
            }

            str1 = new string(r1.CentralStationVpnPassword).Replace("\0", "");
            str2 = new string(r2.CentralStationVpnPassword).Replace("\0", "");
            if (str1 != str2)
            {
                sb.Append(string.Format("中心站VPN专网设置密码: {0}改为{1}\r\n", str1, str2));
            }

            if (r1.CentralStationRemoteVpnEnable != r2.CentralStationRemoteVpnEnable)
            {
                sb.Append(string.Format("中心站远程后台服务器设置VPN: {0}改为{1}\r\n", Common.OpenStatus[r1.CentralStationRemoteVpnEnable], Common.OpenStatus[r2.CentralStationRemoteVpnEnable]));
            }

            str1 = r1.CentralStationIP5[0].ToString() + "." + r1.CentralStationIP5[1].ToString() + "." + r1.CentralStationIP5[2].ToString() + "." + r1.CentralStationIP5[3].ToString();
            str2 = r2.CentralStationIP5[0].ToString() + "." + r2.CentralStationIP5[1].ToString() + "." + r2.CentralStationIP5[2].ToString() + "." + r2.CentralStationIP5[3].ToString();
            if (str1 != str2)
            {
                sb.Append(string.Format("中心站远程后台服务器设置IP地址: {0}改为{1}\r\n", str1, str2));
            }

            str1 = Common.BytesToShort(r1.CentralStationPort5[0], r1.CentralStationPort5[1]).ToString();
            str2 = Common.BytesToShort(r2.CentralStationPort5[0], r2.CentralStationPort5[1]).ToString();
            if (str1 != str2)
            {
                sb.Append(string.Format("中心站远程后台服务器设置端口: {0}改为{1}\r\n", str1, str2));
            }

            if (r1.WaterLevel_Enable != r2.WaterLevel_Enable)
            {
                int b1 = Common.GetIntBit(r1.WaterLevel_Enable, 0);
                int b2 = Common.GetIntBit(r1.WaterLevel_Enable, 1);
                int b11 = Common.GetIntBit(r2.WaterLevel_Enable, 0);
                int b22 = Common.GetIntBit(r2.WaterLevel_Enable, 1);

                if (b1 != b11)
                {
                    if (b1 == 0)
                    {
                        sb.Append("添加水位计1:" + Common.WaterLevelList[r2.WaterLevelDeviceSelect[0]] + "\r\n");
                    }
                    else
                    {
                        sb.Append("删除水位计1:" + Common.WaterLevelList[r1.WaterLevelDeviceSelect[0]] + "\r\n");
                    }
                }

                if (b2 != b22)
                {
                    if (b2 == 0)
                    {
                        sb.Append("添加水位计2:" + Common.WaterLevelList[r2.WaterLevelDeviceSelect[1]] + "\r\n");
                    }
                    else
                    {
                        sb.Append("删除水位计2:" + Common.WaterLevelList[r1.WaterLevelDeviceSelect[1]] + "\r\n");
                    }
                }
            }

            if (r1.WaterLevel_Addr[0] != r2.WaterLevel_Addr[0])
            {
                sb.Append(string.Format("水位计1通信地址: {0}改为{1}\r\n", r1.WaterLevel_Addr[0], r2.WaterLevel_Addr[0]));
            }

            decimal d1 = Convert.ToDecimal(BitConverter.ToUInt32(r1.WaterLevelHight1.Reverse<byte>().ToArray(), 0) / 1000.0);
            decimal d2 = Convert.ToDecimal(BitConverter.ToUInt32(r2.WaterLevelHight1.Reverse<byte>().ToArray(), 0) / 1000.0);
            if (d1 != d2)
            {
                sb.Append(string.Format("水位计1安装高度: {0}改为{1}\r\n", d1, d2));
            }

            d1 = Convert.ToDecimal(BitConverter.ToInt32(r1.WaterBaseLevel1.Reverse<byte>().ToArray(), 0) / 1000.0);
            d2 = Convert.ToDecimal(BitConverter.ToInt32(r2.WaterBaseLevel1.Reverse<byte>().ToArray(), 0) / 1000.0);
            if (d1 != d2)
            {
                sb.Append(string.Format("水位计1基准水位: {0}改为{1}\r\n", d1, d2));
            }

            d1 = Convert.ToDecimal(BitConverter.ToInt32(r1.WaterCorrectionLevel1.Reverse<byte>().ToArray(), 0) / 1000.0);
            d2 = Convert.ToDecimal(BitConverter.ToInt32(r2.WaterCorrectionLevel1.Reverse<byte>().ToArray(), 0) / 1000.0);
            if (d1 != d2)
            {
                sb.Append(string.Format("水位计1水位偏差: {0}改为{1}\r\n", d1, d2));
            }

            d1 = Convert.ToDecimal(BitConverter.ToUInt32(r1.WaterCorrParame1.Reverse<byte>().ToArray(), 0) / 10000.0);
            d2 = Convert.ToDecimal(BitConverter.ToUInt32(r2.WaterCorrParame1.Reverse<byte>().ToArray(), 0) / 10000.0);
            if (d1 != d2)
            {
                sb.Append(string.Format("水位计1水位系数: {0}改为{1}\r\n", d1, d2));
            }

            d1 = Convert.ToDecimal(BitConverter.ToUInt32(r1.WaterLevelHAlarm1.Reverse<byte>().ToArray(), 0) / 100.0);
            d2 = Convert.ToDecimal(BitConverter.ToUInt32(r2.WaterLevelHAlarm1.Reverse<byte>().ToArray(), 0) / 100.0);
            if (d1 != d2)
            {
                sb.Append(string.Format("水位计1高报警水位: {0}改为{1}\r\n", d1, d2));
            }

            d1 = Convert.ToDecimal(BitConverter.ToUInt32(r1.WaterLevelLAlarm1.Reverse<byte>().ToArray(), 0) / 100.0);
            d2 = Convert.ToDecimal(BitConverter.ToUInt32(r2.WaterLevelLAlarm1.Reverse<byte>().ToArray(), 0) / 100.0);
            if (d1 != d2)
            {
                sb.Append(string.Format("水位计1低报警水位: {0}改为{1}\r\n", d1, d2));
            }

            d1 = Convert.ToDecimal(BitConverter.ToUInt32(r1.WaterLevelAlarmH1.Reverse<byte>().ToArray(), 0) / 100.0);
            d2 = Convert.ToDecimal(BitConverter.ToUInt32(r2.WaterLevelAlarmH1.Reverse<byte>().ToArray(), 0) / 100.0);
            if (d1 != d2)
            {
                sb.Append(string.Format("水位计1加报上阈值: {0}改为{1}\r\n", d1, d2));
            }

            d1 = Convert.ToDecimal(BitConverter.ToUInt32(r1.WaterLevelAlarmL1.Reverse<byte>().ToArray(), 0) / 100.0);
            d2 = Convert.ToDecimal(BitConverter.ToUInt32(r2.WaterLevelAlarmL1.Reverse<byte>().ToArray(), 0) / 100.0);
            if (d1 != d2)
            {
                sb.Append(string.Format("水位计1加报下阈值: {0}改为{1}\r\n", d1, d2));
            }

            if (r1.WaterLevelChangeAlarm[0] != r2.WaterLevelChangeAlarm[0])
            {
                sb.Append(string.Format("水位计1水位变幅加报: {0}改为{1}\r\n", r1.WaterLevelChangeAlarm[0] / 100.0, r2.WaterLevelChangeAlarm[0] / 100.0));
            }

            if (r1.WaterFilter[0] != r2.WaterFilter[0])
            {
                sb.Append(string.Format("水位计1滤波次数: {0}改为{1}\r\n", r1.WaterFilter[0], r2.WaterFilter[0]));
            }

            if (r1.WaterFilterParam[0] != r2.WaterFilterParam[0])
            {
                sb.Append(string.Format("水位计1滤波跳动范围设置: {0}改为{1}\r\n", r1.WaterFilterParam[0] / 10.0, r2.WaterFilterParam[0] / 10.0));
            }

            if (r1.WaterLevel_Addr[1] != r2.WaterLevel_Addr[1])
            {
                sb.Append(string.Format("水位计2通信地址: {0}改为{1}\r\n", r1.WaterLevel_Addr[1], r2.WaterLevel_Addr[1]));
            }

            d1 = Convert.ToDecimal(BitConverter.ToUInt32(r1.WaterLevelHight2.Reverse<byte>().ToArray(), 0) / 1000.0);
            d2 = Convert.ToDecimal(BitConverter.ToUInt32(r2.WaterLevelHight2.Reverse<byte>().ToArray(), 0) / 1000.0);
            if (d1 != d2)
            {
                sb.Append(string.Format("水位计2安装高度: {0}改为{1}\r\n", d1, d2));
            }

            d1 = Convert.ToDecimal(BitConverter.ToInt32(r1.WaterBaseLevel2.Reverse<byte>().ToArray(), 0) / 1000.0);
            d2 = Convert.ToDecimal(BitConverter.ToInt32(r2.WaterBaseLevel2.Reverse<byte>().ToArray(), 0) / 1000.0);
            if (d1 != d2)
            {
                sb.Append(string.Format("水位计2基准水位: {0}改为{1}\r\n", d1, d2));
            }

            d1 = Convert.ToDecimal(BitConverter.ToInt32(r1.WaterCorrectionLevel2.Reverse<byte>().ToArray(), 0) / 1000.0);
            d2 = Convert.ToDecimal(BitConverter.ToInt32(r2.WaterCorrectionLevel2.Reverse<byte>().ToArray(), 0) / 1000.0);
            if (d1 != d2)
            {
                sb.Append(string.Format("水位计2水位偏差: {0}改为{1}\r\n", d1, d2));
            }

            d1 = Convert.ToDecimal(BitConverter.ToUInt32(r1.WaterCorrParame2.Reverse<byte>().ToArray(), 0) / 10000.0);
            d2 = Convert.ToDecimal(BitConverter.ToUInt32(r2.WaterCorrParame2.Reverse<byte>().ToArray(), 0) / 10000.0);
            if (d1 != d2)
            {
                sb.Append(string.Format("水位计2水位系数: {0}改为{1}\r\n", d1, d2));
            }

            d1 = Convert.ToDecimal(BitConverter.ToUInt32(r1.WaterLevelHAlarm2.Reverse<byte>().ToArray(), 0) / 100.0);
            d2 = Convert.ToDecimal(BitConverter.ToUInt32(r2.WaterLevelHAlarm2.Reverse<byte>().ToArray(), 0) / 100.0);
            if (d1 != d2)
            {
                sb.Append(string.Format("水位计2高报警水位: {0}改为{1}\r\n", d1, d2));
            }

            d1 = Convert.ToDecimal(BitConverter.ToUInt32(r1.WaterLevelLAlarm2.Reverse<byte>().ToArray(), 0) / 100.0);
            d2 = Convert.ToDecimal(BitConverter.ToUInt32(r2.WaterLevelLAlarm2.Reverse<byte>().ToArray(), 0) / 100.0);
            if (d1 != d2)
            {
                sb.Append(string.Format("水位计2低报警水位: {0}改为{1}\r\n", d1, d2));
            }

            d1 = Convert.ToDecimal(BitConverter.ToUInt32(r1.WaterLevelAlarmH2.Reverse<byte>().ToArray(), 0) / 100.0);
            d2 = Convert.ToDecimal(BitConverter.ToUInt32(r2.WaterLevelAlarmH2.Reverse<byte>().ToArray(), 0) / 100.0);
            if (d1 != d2)
            {
                sb.Append(string.Format("水位计2加报上阈值: {0}改为{1}\r\n", d1, d2));
            }

            d1 = Convert.ToDecimal(BitConverter.ToUInt32(r1.WaterLevelAlarmL2.Reverse<byte>().ToArray(), 0) / 100.0);
            d2 = Convert.ToDecimal(BitConverter.ToUInt32(r2.WaterLevelAlarmL2.Reverse<byte>().ToArray(), 0) / 100.0);
            if (d1 != d2)
            {
                sb.Append(string.Format("水位计2加报下阈值: {0}改为{1}\r\n", d1, d2));
            }

            if (r1.WaterLevelChangeAlarm[1] != r2.WaterLevelChangeAlarm[1])
            {
                sb.Append(string.Format("水位计2水位变幅加报: {0}改为{1}\r\n", r1.WaterLevelChangeAlarm[1] / 100.0, r2.WaterLevelChangeAlarm[1] / 100.0));
            }

            if (r1.WaterFilter[1] != r2.WaterFilter[1])
            {
                sb.Append(string.Format("水位计2滤波次数: {0}改为{1}\r\n", r1.WaterFilter[1], r2.WaterFilter[1]));
            }

            if (r1.WaterFilterParam[1] != r2.WaterFilterParam[1])
            {
                sb.Append(string.Format("水位计2滤波跳动范围设置: {0}改为{1}\r\n", r1.WaterFilterParam[1] / 10.0, r2.WaterFilterParam[1] / 10.0));
            }

            if (r1.CurrentSpeed_Enable != r2.CurrentSpeed_Enable)
            {
                int b1 = Common.GetIntBit(r1.CurrentSpeed_Enable, 0);
                int b2 = Common.GetIntBit(r1.CurrentSpeed_Enable, 1);
                int b11 = Common.GetIntBit(r2.CurrentSpeed_Enable, 0);
                int b22 = Common.GetIntBit(r2.CurrentSpeed_Enable, 1);

                if (b1 != b11)
                {
                    if (b1 == 0)
                    {
                        sb.Append("添加流速仪1:" + Common.CurrentSpeedList[r2.CurrentSpeedDeviceSelect[0]] + "\r\n");
                    }
                    else
                    {
                        sb.Append("删除流速仪1:" + Common.CurrentSpeedList[r1.CurrentSpeedDeviceSelect[0]] + "\r\n");
                    }
                }

                if (b2 != b22)
                {
                    if (b2 == 0)
                    {
                        sb.Append("添加流速仪2:" + Common.CurrentSpeedList[r2.CurrentSpeedDeviceSelect[1]] + "\r\n");
                    }
                    else
                    {
                        sb.Append("删除流速仪2:" + Common.CurrentSpeedList[r1.CurrentSpeedDeviceSelect[1]] + "\r\n");
                    }
                }
            }

            if (r1.CurrentSpeed_Addr[0] != r2.CurrentSpeed_Addr[0])
            {
                sb.Append(string.Format("流速仪1通信地址: {0}改为{1}\r\n", r1.CurrentSpeed_Addr[0], r2.CurrentSpeed_Addr[0]));
            }

            d1 = Convert.ToDecimal(BitConverter.ToInt32(r1.CurrentSpeedDeviation1.Reverse<byte>().ToArray(), 0) / 1000.0);
            d2 = Convert.ToDecimal(BitConverter.ToInt32(r2.CurrentSpeedDeviation1.Reverse<byte>().ToArray(), 0) / 1000.0);
            if (d1 != d2)
            {
                sb.Append(string.Format("流速仪1流速偏差: {0}改为{1}\r\n", d1, d2));
            }

            d1 = Convert.ToDecimal(BitConverter.ToInt32(r1.CurrentSpeedRatio1.Reverse<byte>().ToArray(), 0) / 10000.0);
            d2 = Convert.ToDecimal(BitConverter.ToInt32(r2.CurrentSpeedRatio1.Reverse<byte>().ToArray(), 0) / 10000.0);
            if (d1 != d2)
            {
                sb.Append(string.Format("流速仪1流速系数: {0}改为{1}\r\n", d1, d2));
            }

            if (r1.CurrentSpeed_Addr[1] != r2.CurrentSpeed_Addr[1])
            {
                sb.Append(string.Format("流速仪2通信地址: {0}改为{1}\r\n", r1.CurrentSpeed_Addr[1], r2.CurrentSpeed_Addr[1]));
            }

            d1 = Convert.ToDecimal(BitConverter.ToInt32(r1.CurrentSpeedDeviation2.Reverse<byte>().ToArray(), 0) / 1000.0);
            d2 = Convert.ToDecimal(BitConverter.ToInt32(r2.CurrentSpeedDeviation2.Reverse<byte>().ToArray(), 0) / 1000.0);
            if (d1 != d2)
            {
                sb.Append(string.Format("流速仪2流速偏差: {0}改为{1}\r\n", d1, d2));
            }

            d1 = Convert.ToDecimal(BitConverter.ToInt32(r1.CurrentSpeedRatio2.Reverse<byte>().ToArray(), 0) / 10000.0);
            d2 = Convert.ToDecimal(BitConverter.ToInt32(r2.CurrentSpeedRatio2.Reverse<byte>().ToArray(), 0) / 10000.0);
            if (d1 != d2)
            {
                sb.Append(string.Format("流速仪2流速系数: {0}改为{1}\r\n", d1, d2));
            }

            if (r1.WaterFlow_Enable != r2.WaterFlow_Enable)
            {
                int b1 = Common.GetIntBit(r1.WaterFlow_Enable, 0);
                int b2 = Common.GetIntBit(r1.WaterFlow_Enable, 1);
                int b11 = Common.GetIntBit(r2.WaterFlow_Enable, 0);
                int b22 = Common.GetIntBit(r2.WaterFlow_Enable, 1);

                if (b1 != b11)
                {
                    if (b1 == 0)
                    {
                        sb.Append("添加流量计1:" + Common.FlowmeterList[r2.WaterFlowDeviceSelect[0]] + "\r\n");
                    }
                    else
                    {
                        sb.Append("删除流量计1:" + Common.FlowmeterList[r1.WaterFlowDeviceSelect[0]] + "\r\n");
                    }
                }

                if (b2 != b22)
                {
                    if (b2 == 0)
                    {
                        sb.Append("添加流量计2:" + Common.FlowmeterList[r2.WaterFlowDeviceSelect[1]] + "\r\n");
                    }
                    else
                    {
                        sb.Append("删除流量计2:" + Common.FlowmeterList[r1.WaterFlowDeviceSelect[1]] + "\r\n");
                    }
                }
            }

            if (r1.WaterFlow_Addr[0] != r2.WaterFlow_Addr[0])
            {
                sb.Append(string.Format("流量计1通信地址: {0}改为{1}\r\n", r1.WaterFlow_Addr[0], r2.WaterFlow_Addr[0]));
            }

            d1 = Convert.ToDecimal(BitConverter.ToUInt32(r1.WaterFlowHeight1.Reverse<byte>().ToArray(), 0) / 1000.0);
            d2 = Convert.ToDecimal(BitConverter.ToUInt32(r2.WaterFlowHeight1.Reverse<byte>().ToArray(), 0) / 1000.0);
            if (d1 != d2)
            {
                sb.Append(string.Format("流量计1安装高度: {0}改为{1}\r\n", d1, d2));
            }

            d1 = Convert.ToDecimal(BitConverter.ToInt32(r1.WaterFlowWaterLevelDeviation1.Reverse<byte>().ToArray(), 0) / 1000.0);
            d2 = Convert.ToDecimal(BitConverter.ToInt32(r2.WaterFlowWaterLevelDeviation1.Reverse<byte>().ToArray(), 0) / 1000.0);
            if (d1 != d2)
            {
                sb.Append(string.Format("流量计1水位偏差: {0}改为{1}\r\n", d1, d2));
            }

            d1 = Convert.ToDecimal(BitConverter.ToUInt32(r1.WaterFlowWaterLevelRatio1.Reverse<byte>().ToArray(), 0) / 10000.0);
            d2 = Convert.ToDecimal(BitConverter.ToUInt32(r2.WaterFlowWaterLevelRatio1.Reverse<byte>().ToArray(), 0) / 10000.0);
            if (d1 != d2)
            {
                sb.Append(string.Format("流量计1水位系数: {0}改为{1}\r\n", d1, d2));
            }

            d1 = Convert.ToDecimal(BitConverter.ToInt32(r1.WaterFlowCurrentSpeedDeviation1.Reverse<byte>().ToArray(), 0) / 1000.0);
            d2 = Convert.ToDecimal(BitConverter.ToInt32(r2.WaterFlowCurrentSpeedDeviation1.Reverse<byte>().ToArray(), 0) / 1000.0);
            if (d1 != d2)
            {
                sb.Append(string.Format("流量计1流速偏差: {0}改为{1}\r\n", d1, d2));
            }

            d1 = Convert.ToDecimal(BitConverter.ToUInt32(r1.WaterFlowCurrentSpeedRatio1.Reverse<byte>().ToArray(), 0) / 10000.0);
            d2 = Convert.ToDecimal(BitConverter.ToUInt32(r2.WaterFlowCurrentSpeedRatio1.Reverse<byte>().ToArray(), 0) / 10000.0);
            if (d1 != d2)
            {
                sb.Append(string.Format("流量计1流速系数: {0}改为{1}\r\n", d1, d2));
            }

            if (r1.WaterFlow_Addr[1] != r2.WaterFlow_Addr[1])
            {
                sb.Append(string.Format("流量计2通信地址: {0}改为{1}\r\n", r1.WaterFlow_Addr[1], r2.WaterFlow_Addr[1]));
            }

            d1 = Convert.ToDecimal(BitConverter.ToUInt32(r1.WaterFlowHeight2.Reverse<byte>().ToArray(), 0) / 1000.0);
            d2 = Convert.ToDecimal(BitConverter.ToUInt32(r2.WaterFlowHeight2.Reverse<byte>().ToArray(), 0) / 1000.0);
            if (d1 != d2)
            {
                sb.Append(string.Format("流量计2安装高度: {0}改为{1}\r\n", d1, d2));
            }

            d1 = Convert.ToDecimal(BitConverter.ToInt32(r1.WaterFlowWaterLevelDeviation2.Reverse<byte>().ToArray(), 0) / 1000.0);
            d2 = Convert.ToDecimal(BitConverter.ToInt32(r2.WaterFlowWaterLevelDeviation2.Reverse<byte>().ToArray(), 0) / 1000.0);
            if (d1 != d2)
            {
                sb.Append(string.Format("流量计2水位偏差: {0}改为{1}\r\n", d1, d2));
            }

            d1 = Convert.ToDecimal(BitConverter.ToUInt32(r1.WaterFlowWaterLevelRatio2.Reverse<byte>().ToArray(), 0) / 10000.0);
            d2 = Convert.ToDecimal(BitConverter.ToUInt32(r2.WaterFlowWaterLevelRatio2.Reverse<byte>().ToArray(), 0) / 10000.0);
            if (d1 != d2)
            {
                sb.Append(string.Format("流量计2水位系数: {0}改为{1}\r\n", d1, d2));
            }

            d1 = Convert.ToDecimal(BitConverter.ToInt32(r1.WaterFlowCurrentSpeedDeviation2.Reverse<byte>().ToArray(), 0) / 1000.0);
            d2 = Convert.ToDecimal(BitConverter.ToInt32(r2.WaterFlowCurrentSpeedDeviation2.Reverse<byte>().ToArray(), 0) / 1000.0);
            if (d1 != d2)
            {
                sb.Append(string.Format("流量计2流速偏差: {0}改为{1}\r\n", d1, d2));
            }

            d1 = Convert.ToDecimal(BitConverter.ToUInt32(r1.WaterFlowCurrentSpeedRatio2.Reverse<byte>().ToArray(), 0) / 10000.0);
            d2 = Convert.ToDecimal(BitConverter.ToUInt32(r2.WaterFlowCurrentSpeedRatio2.Reverse<byte>().ToArray(), 0) / 10000.0);
            if (d1 != d2)
            {
                sb.Append(string.Format("流量计2流速系数: {0}改为{1}\r\n", d1, d2));
            }

            if (r1.GatePosition_Enable != r2.GatePosition_Enable)
            {
                int b1 = Common.GetIntBit(r1.GatePosition_Enable, 0);
                int b2 = Common.GetIntBit(r1.GatePosition_Enable, 1);
                int b11 = Common.GetIntBit(r2.GatePosition_Enable, 0);
                int b22 = Common.GetIntBit(r2.GatePosition_Enable, 1);

                if (b1 != b11)
                {
                    if (b1 == 0)
                    {
                        sb.Append("添加闸位计1:" + Common.GatePositionList[r2.GatePositionDeviceSelect[0]] + "\r\n");
                    }
                    else
                    {
                        sb.Append("删除闸位计1:" + Common.GatePositionList[r1.GatePositionDeviceSelect[0]] + "\r\n");
                    }
                }

                if (b2 != b22)
                {
                    if (b2 == 0)
                    {
                        sb.Append("添加闸位计2:" + Common.GatePositionList[r2.GatePositionDeviceSelect[1]] + "\r\n");
                    }
                    else
                    {
                        sb.Append("删除闸位计2:" + Common.GatePositionList[r1.GatePositionDeviceSelect[1]] + "\r\n");
                    }
                }
            }

            if (r1.GatePosition_Addr[0] != r2.GatePosition_Addr[0])
            {
                sb.Append(string.Format("闸位计1通信地址: {0}改为{1}\r\n", r1.GatePosition_Addr[0], r2.GatePosition_Addr[0]));
            }

            d1 = Convert.ToDecimal(BitConverter.ToInt32(r1.GatePositionZeroing1.Reverse<byte>().ToArray(), 0) / 1000.0);
            d2 = Convert.ToDecimal(BitConverter.ToInt32(r2.GatePositionZeroing1.Reverse<byte>().ToArray(), 0) / 1000.0);
            if (d1 != d2)
            {
                sb.Append(string.Format("闸位计1闸位计调零: {0}改为{1}\r\n", d1, d2));
            }

            if (r1.GatePositionDirection[0] != r2.GatePositionDirection[0])
            {
                sb.Append(string.Format("闸位计1增长方式: {0}改为{1}\r\n", Common.PositionDirection[r1.GatePositionDirection[0]], Common.PositionDirection[r2.GatePositionDirection[0]]));
            }

            if (r1.GatePosition_Addr[1] != r2.GatePosition_Addr[1])
            {
                sb.Append(string.Format("闸位计2通信地址: {0}改为{1}\r\n", r1.GatePosition_Addr[1], r2.GatePosition_Addr[1]));
            }

            d1 = Convert.ToDecimal(BitConverter.ToInt32(r1.GatePositionZeroing2.Reverse<byte>().ToArray(), 0) / 1000.0);
            d2 = Convert.ToDecimal(BitConverter.ToInt32(r2.GatePositionZeroing2.Reverse<byte>().ToArray(), 0) / 1000.0);
            if (d1 != d2)
            {
                sb.Append(string.Format("闸位计2闸位计调零: {0}改为{1}\r\n", d1, d2));
            }

            if (r1.GatePositionDirection[1] != r2.GatePositionDirection[1])
            {
                sb.Append(string.Format("闸位计2增长方式: {0}改为{1}\r\n", Common.PositionDirection[r1.GatePositionDirection[1]], Common.PositionDirection[r2.GatePositionDirection[1]]));
            }

            if (r1.RainFall_Enable != r2.RainFall_Enable)
            {
                if (r1.RainFall_Enable == 0)
                {
                    sb.Append("添加雨量计:" + Common.RainFallList[r2.RainFallDeviceSelect] + "\r\n");
                }
                else
                {
                    sb.Append("删除雨量计:" + Common.RainFallList[r1.RainFallDeviceSelect] + "\r\n");
                }
            }

            if (r1.RainResolutionRatio != r2.RainResolutionRatio)
            {
                sb.Append(string.Format("雨量计分辨率: {0}改为{1}\r\n", Common.RainFallResolutionRatio[r1.RainResolutionRatio], Common.RainFallResolutionRatio[r2.RainResolutionRatio]));
            }

            if (r1.RainAlarm != r2.RainAlarm)
            {
                sb.Append(string.Format("雨量计加报阈值: {0}改为{1}\r\n", r1.RainAlarm / 10.0, r2.RainAlarm / 10.0));
            }

            if (r1.RainTimeReport != r2.RainTimeReport)
            {
                sb.Append(string.Format("雨量计时段加报: {0}改为{1}\r\n", Common.OpenStatus[r1.RainTimeReport], Common.OpenStatus[r2.RainTimeReport]));
            }

            d1 = Convert.ToDecimal(BitConverter.ToUInt32(r1.DayRain.Reverse<byte>().ToArray(), 0) / 10.0);
            d2 = Convert.ToDecimal(BitConverter.ToUInt32(r2.DayRain.Reverse<byte>().ToArray(), 0) / 10.0);
            if (d1 != d2)
            {
                sb.Append(string.Format("雨量计日雨量: {0}改为{1}\r\n", d1, d2));
            }

            d1 = Convert.ToDecimal(BitConverter.ToUInt32(r1.TotalRain.Reverse<byte>().ToArray(), 0) / 10.0);
            d2 = Convert.ToDecimal(BitConverter.ToUInt32(r2.TotalRain.Reverse<byte>().ToArray(), 0) / 10.0);
            if (d1 != d2)
            {
                sb.Append(string.Format("雨量计累计雨量: {0}改为{1}\r\n", d1, d2));
            }

            if (r1.WaterQuality_Enable[0] != r2.WaterQuality_Enable[0])
            {
                int b1 = Common.GetIntBit(r1.WaterQuality_Enable[0], 0);
                int b2 = Common.GetIntBit(r1.WaterQuality_Enable[0], 1);
                int b3 = Common.GetIntBit(r1.WaterQuality_Enable[0], 2);
                int b4 = Common.GetIntBit(r1.WaterQuality_Enable[0], 3);
                int b5 = Common.GetIntBit(r1.WaterQuality_Enable[0], 4);
                int b6 = Common.GetIntBit(r1.WaterQuality_Enable[0], 5);
                int b7 = Common.GetIntBit(r1.WaterQuality_Enable[0], 6);
                int b8 = Common.GetIntBit(r1.WaterQuality_Enable[0], 7);
                int b9 = Common.GetIntBit(r1.WaterQuality_Enable[1], 0);

                int b11 = Common.GetIntBit(r2.WaterQuality_Enable[0], 0);
                int b22 = Common.GetIntBit(r2.WaterQuality_Enable[0], 1);
                int b33 = Common.GetIntBit(r2.WaterQuality_Enable[0], 2);
                int b44 = Common.GetIntBit(r2.WaterQuality_Enable[0], 3);
                int b55 = Common.GetIntBit(r2.WaterQuality_Enable[0], 4);
                int b66 = Common.GetIntBit(r2.WaterQuality_Enable[0], 5);
                int b77 = Common.GetIntBit(r2.WaterQuality_Enable[0], 6);
                int b88 = Common.GetIntBit(r2.WaterQuality_Enable[0], 7);
                int b99 = Common.GetIntBit(r2.WaterQuality_Enable[1], 0);

                if (b1 != b11)
                {
                    if (b1 == 0)
                    {
                        sb.Append("添加水质:");
                    }
                    else
                    {
                        sb.Append("删除水质:");
                    }
                    sb.Append(Common.WaterQualityList[0] + "\r\n");
                }

                if (b2 != b22)
                {
                    if (b2 == 0)
                    {
                        sb.Append("添加水质:");
                    }
                    else
                    {
                        sb.Append("删除水质:");
                    }
                    sb.Append(Common.WaterQualityList[1] + "\r\n");
                }

                if (b3 != b33)
                {
                    if (b3 == 0)
                    {
                        sb.Append("添加水质:");
                    }
                    else
                    {
                        sb.Append("删除水质:");
                    }
                    sb.Append(Common.WaterQualityList[2] + "\r\n");
                }

                if (b4 != b44)
                {
                    if (b4 == 0)
                    {
                        sb.Append("添加水质:");
                    }
                    else
                    {
                        sb.Append("删除水质:");
                    }
                    sb.Append(Common.WaterQualityList[3] + "\r\n");
                }

                if (b5 != b55)
                {
                    if (b5 == 0)
                    {
                        sb.Append("添加水质:");
                    }
                    else
                    {
                        sb.Append("删除水质:");
                    }
                    sb.Append(Common.WaterQualityList[4] + "\r\n");
                }

                if (b6 != b66)
                {
                    if (b6 == 0)
                    {
                        sb.Append("添加水质:");
                    }
                    else
                    {
                        sb.Append("删除水质:");
                    }
                    sb.Append(Common.WaterQualityList[5] + "\r\n");
                }

                if (b7 != b77)
                {
                    if (b7 == 0)
                    {
                        sb.Append("添加水质:");
                    }
                    else
                    {
                        sb.Append("删除水质:");
                    }
                    sb.Append(Common.WaterQualityList[6] + "\r\n");
                }

                if (b8 != b88)
                {
                    if (b8 == 0)
                    {
                        sb.Append("添加水质:");
                    }
                    else
                    {
                        sb.Append("删除水质:");
                    }
                    sb.Append(Common.WaterQualityList[7] + "\r\n");
                }


                if (b9 != b99)
                {
                    if (b8 == 0)
                    {
                        sb.Append("添加水质:");
                    }
                    else
                    {
                        sb.Append("删除水质:");
                    }
                    sb.Append(Common.WaterQualityList[8] + "\r\n");
                }
            }

            if (r1.WaterQuality_PH_Addr != r2.WaterQuality_PH_Addr)
            {
                sb.Append(string.Format("在线PH传感器通信地址: {0}改为{1}\r\n", r1.WaterQuality_PH_Addr, r2.WaterQuality_PH_Addr));
            }

            if (r1.WaterQuality_Rjy_Addr != r2.WaterQuality_Rjy_Addr)
            {
                sb.Append(string.Format("在线溶解氧传感器通信地址: {0}改为{1}\r\n", r1.WaterQuality_Rjy_Addr, r2.WaterQuality_Rjy_Addr));
            }

            if (r1.WaterQuality_Ddl_Addr != r2.WaterQuality_Ddl_Addr)
            {
                sb.Append(string.Format("在线电导率传感器通信地址: {0}改为{1}\r\n", r1.WaterQuality_Ddl_Addr, r2.WaterQuality_Ddl_Addr));
            }

            if (r1.WaterQuality_Zd1000_Addr != r2.WaterQuality_Zd1000_Addr)
            {
                sb.Append(string.Format("在线浊度传感器(1000NTU)通信地址: {0}改为{1}\r\n", r1.WaterQuality_Zd1000_Addr, r2.WaterQuality_Zd1000_Addr));
            }

            if (r1.WaterQuality_Zd4000_Addr != r2.WaterQuality_Zd4000_Addr)
            {
                sb.Append(string.Format("在线浊度传感器(4000NTU)通信地址: {0}改为{1}\r\n", r1.WaterQuality_Zd4000_Addr, r2.WaterQuality_Zd4000_Addr));
            }

            if (r1.WaterQuality_COD_Addr != r2.WaterQuality_COD_Addr)
            {
                sb.Append(string.Format("在线COD传感器通信地址: {0}改为{1}\r\n", r1.WaterQuality_COD_Addr, r2.WaterQuality_COD_Addr));
            }

            if (r1.WaterQuality_Ad_Addr != r2.WaterQuality_Ad_Addr)
            {
                sb.Append(string.Format("在线氨氮传感器通信地址: {0}改为{1}\r\n", r1.WaterQuality_Ad_Addr, r2.WaterQuality_Ad_Addr));
            }

            if (r1.WaterQuality_Yl_Addr != r2.WaterQuality_Yl_Addr)
            {
                sb.Append(string.Format("在线余氯传感器通信地址: {0}改为{1}\r\n", r1.WaterQuality_Yl_Addr, r2.WaterQuality_Yl_Addr));
            }

            if (r1.WaterQuality_Sz_Addr != r2.WaterQuality_Sz_Addr)
            {
                sb.Append(string.Format("在线多参数水质传感器通信地址: {0}改为{1}\r\n", r1.WaterQuality_Sz_Addr, r2.WaterQuality_Sz_Addr));
            }

            if (r1.Camera_Enable != r2.Camera_Enable)
            {
                int b1 = Common.GetIntBit(r1.Camera_Enable, 0);
                int b2 = Common.GetIntBit(r1.Camera_Enable, 1);
                int b11 = Common.GetIntBit(r2.Camera_Enable, 0);
                int b22 = Common.GetIntBit(r2.Camera_Enable, 1);

                if (b1 != b11)
                {
                    if (b1 == 0)
                    {
                        sb.Append("添加相机1:" + Common.CameraList[r2.CameraDeviceSelect[0]] + "\r\n");
                    }
                    else
                    {
                        sb.Append("删除相机1:" + Common.CameraList[r1.CameraDeviceSelect[0]] + "\r\n");
                    }
                }

                if (b2 != b22)
                {
                    if (b2 == 0)
                    {
                        sb.Append("添加相机2:" + Common.CameraList[r2.CameraDeviceSelect[1]] + "\r\n");
                    }
                    else
                    {
                        sb.Append("删除相机2:" + Common.CameraList[r1.CameraDeviceSelect[1]] + "\r\n");
                    }
                }
            }

            if (r1.Camera_Addr[0] != r2.Camera_Addr[0])
            {
                sb.Append(string.Format("相机1通信地址: {0}改为{1}\r\n", r1.Camera_Addr[0], r2.Camera_Addr[0]));
            }

            if (r1.Camera_Overlying[0] != r2.Camera_Overlying[0])
            {
                sb.Append(string.Format("相机1数据叠加: {0}改为{1}\r\n", Common.OpenStatus[r1.Camera_Overlying[0]], Common.OpenStatus[r2.Camera_Overlying[0]]));
            }

            uint u1 = BitConverter.ToUInt16(r1.Camera_AcquisitionCycle1.Reverse<byte>().ToArray(), 0);
            uint u2 = BitConverter.ToUInt16(r2.Camera_AcquisitionCycle1.Reverse<byte>().ToArray(), 0);
            if (u1 != u2)
            {
                sb.Append(string.Format("相机1图片采集周期: {0}改为{1}\r\n", u1, u2));
            }

            if (r1.Camera_TimeInterval[0] != r2.Camera_TimeInterval[0])
            {
                sb.Append(string.Format("相机1图片采集时段: {0}改为{1}\r\n", Common.CameraTimeInterval[r1.Camera_TimeInterval[0]], Common.CameraTimeInterval[r2.Camera_TimeInterval[0]]));
            }

            if (r1.Camera_Cache[0] != r2.Camera_Cache[0])
            {
                sb.Append(string.Format("相机1图片缓存模式: {0}改为{1}\r\n", Common.OpenStatus[r1.Camera_Cache[0]], Common.OpenStatus[r2.Camera_Cache[0]]));
            }

            if (r1.Camera_PicAck[0] != r2.Camera_PicAck[0])
            {
                sb.Append(string.Format("相机1图片报文响应: {0}改为{1}\r\n", Common.CameraPicAck[r1.Camera_PicAck[0]], Common.CameraPicAck[r2.Camera_PicAck[0]]));
            }

            StringBuilder s1 = new StringBuilder();
            StringBuilder s2 = new StringBuilder();
            if (r1.Camera_Hours1[0] != r2.Camera_Hours1[0] || r1.Camera_Hours1[1] != r2.Camera_Hours1[1] || r1.Camera_Hours1[2] != r2.Camera_Hours1[2])
            {
                if (r1.Camera_Hours1[0] != r2.Camera_Hours1[0])
                {
                    for (int i = 0; i < 8; i++)
                    {
                        int b1 = Common.GetIntBit(r1.Camera_Hours1[0], i);
                        int b2 = Common.GetIntBit(r2.Camera_Hours1[0], i);
                        if (b1 == 1)
                        {
                            s1.Append(Common.CameraHours[i].ToString() + ",");
                        }

                        if (b2 == 1)
                        {
                            s2.Append(Common.CameraHours[i].ToString() + ",");
                        }
                    }
                }

                if (r1.Camera_Hours1[1] != r2.Camera_Hours1[1])
                {
                    for (int i = 0; i < 8; i++)
                    {
                        int b1 = Common.GetIntBit(r1.Camera_Hours1[1], i);
                        int b2 = Common.GetIntBit(r2.Camera_Hours1[1], i);
                        if (b1 == 1)
                        {
                            s1.Append(Common.CameraHours[i + 8].ToString() + ",");
                        }

                        if (b2 == 1)
                        {
                            s2.Append(Common.CameraHours[i + 8].ToString() + ",");
                        }
                    }
                }

                if (r1.Camera_Hours1[2] != r2.Camera_Hours1[2])
                {
                    for (int i = 0; i < 8; i++)
                    {
                        int b1 = Common.GetIntBit(r1.Camera_Hours1[2], i);
                        int b2 = Common.GetIntBit(r2.Camera_Hours1[2], i);
                        if (b1 == 1)
                        {
                            s1.Append(Common.CameraHours[i + 16].ToString() + ",");
                        }

                        if (b2 == 1)
                        {
                            s2.Append(Common.CameraHours[i + 16].ToString() + ",");
                        }
                    }
                }
                sb.Append(string.Format("相机1加报上报时段: {0}改为{1}\r\n", s1.ToString().TrimEnd(new char[] { ',' }), s2.ToString().TrimEnd(new char[] { ',' })));
            }

            if (r1.Camera_Addr[1] != r2.Camera_Addr[1])
            {
                sb.Append(string.Format("相机2通信地址: {0}改为{1}\r\n", r1.Camera_Addr[1], r2.Camera_Addr[1]));
            }

            if (r1.Camera_Overlying[1] != r2.Camera_Overlying[1])
            {
                sb.Append(string.Format("相机2数据叠加: {0}改为{1}\r\n", Common.OpenStatus[r1.Camera_Overlying[1]], Common.OpenStatus[r2.Camera_Overlying[1]]));
            }

            u1 = BitConverter.ToUInt16(r1.Camera_AcquisitionCycle2.Reverse<byte>().ToArray(), 0);
            u2 = BitConverter.ToUInt16(r2.Camera_AcquisitionCycle2.Reverse<byte>().ToArray(), 0);
            if (u1 != u2)
            {
                sb.Append(string.Format("相机2图片采集周期: {0}改为{1}\r\n", u1, u2));
            }

            if (r1.Camera_TimeInterval[1] != r2.Camera_TimeInterval[1])
            {
                sb.Append(string.Format("相机2图片采集时段: {0}改为{1}\r\n", Common.CameraTimeInterval[r1.Camera_TimeInterval[1]], Common.CameraTimeInterval[r2.Camera_TimeInterval[1]]));
            }

            if (r1.Camera_Cache[1] != r2.Camera_Cache[1])
            {
                sb.Append(string.Format("相机2图片缓存模式: {0}改为{1}\r\n", Common.OpenStatus[r1.Camera_Cache[1]], Common.OpenStatus[r2.Camera_Cache[1]]));
            }

            if (r1.Camera_PicAck[1] != r2.Camera_PicAck[1])
            {
                sb.Append(string.Format("相机2图片报文响应: {0}改为{1}\r\n", Common.CameraPicAck[r1.Camera_PicAck[1]], Common.CameraPicAck[r2.Camera_PicAck[1]]));
            }

            s1.Clear();
            s2.Clear();
            if (r1.Camera_Hours2[0] != r2.Camera_Hours2[0] || r1.Camera_Hours2[1] != r2.Camera_Hours2[1] || r1.Camera_Hours2[2] != r2.Camera_Hours2[2])
            {
                if (r1.Camera_Hours2[0] != r2.Camera_Hours2[0])
                {
                    for (int i = 0; i < 8; i++)
                    {
                        int b1 = Common.GetIntBit(r1.Camera_Hours2[0], i);
                        int b2 = Common.GetIntBit(r2.Camera_Hours2[0], i);
                        if (b1 == 1)
                        {
                            s1.Append(Common.CameraHours[i].ToString() + ",");
                        }

                        if (b2 == 1)
                        {
                            s2.Append(Common.CameraHours[i].ToString() + ",");
                        }
                    }
                }

                if (r1.Camera_Hours2[1] != r2.Camera_Hours2[1])
                {
                    for (int i = 0; i < 8; i++)
                    {
                        int b1 = Common.GetIntBit(r1.Camera_Hours2[1], i);
                        int b2 = Common.GetIntBit(r2.Camera_Hours2[1], i);
                        if (b1 == 1)
                        {
                            s1.Append(Common.CameraHours[i + 8].ToString() + ",");
                        }

                        if (b2 == 1)
                        {
                            s2.Append(Common.CameraHours[i + 8].ToString() + ",");
                        }
                    }
                }

                if (r1.Camera_Hours2[2] != r2.Camera_Hours2[2])
                {
                    for (int i = 0; i < 8; i++)
                    {
                        int b1 = Common.GetIntBit(r1.Camera_Hours2[2], i);
                        int b2 = Common.GetIntBit(r2.Camera_Hours2[2], i);
                        if (b1 == 1)
                        {
                            s1.Append(Common.CameraHours[i + 16].ToString() + ",");
                        }

                        if (b2 == 1)
                        {
                            s2.Append(Common.CameraHours[i + 16].ToString() + ",");
                        }
                    }
                }
                sb.Append(string.Format("相机2加报上报时段: {0}改为{1}\r\n", s1.ToString().TrimEnd(new char[] { ',' }), s2.ToString().TrimEnd(new char[] { ',' })));
            }
            s1.Clear();
            s2.Clear();

            if (r1.Video_Enable != r2.Video_Enable)
            {
                int b1 = Common.GetIntBit(r1.Video_Enable, 0);
                int b2 = Common.GetIntBit(r1.Video_Enable, 1);
                int b11 = Common.GetIntBit(r2.Video_Enable, 0);
                int b22 = Common.GetIntBit(r2.Video_Enable, 1);

                if (b1 != b11)
                {
                    if (b1 == 0)
                    {
                        sb.Append("添加摄像头1:" + Common.VideoList[r2.VideoDeviceSelect[0]] + "\r\n");
                    }
                    else
                    {
                        sb.Append("删除摄像头1:" + Common.VideoList[r1.VideoDeviceSelect[0]] + "\r\n");
                    }
                }

                if (b2 != b22)
                {
                    if (b2 == 0)
                    {
                        sb.Append("添加摄像头2:" + Common.VideoList[r2.VideoDeviceSelect[1]] + "\r\n");
                    }
                    else
                    {
                        sb.Append("删除摄像头2:" + Common.VideoList[r1.VideoDeviceSelect[1]] + "\r\n");
                    }
                }
            }

            if (r1.VideoOverlayUpdateTime[0] != r2.VideoOverlayUpdateTime[0])
            {
                sb.Append(string.Format("摄像头1视频叠加更新时间: {0}改为{1}\r\n", r1.VideoOverlayUpdateTime[0], r2.VideoOverlayUpdateTime[0]));
            }

            string strIP1 = r1.VideoIP1[0].ToString() + "." + r1.VideoIP1[1].ToString() + "." + r1.VideoIP1[2].ToString() + "." + r1.VideoIP1[3].ToString();
            string strIP2 = r2.VideoIP1[0].ToString() + "." + r2.VideoIP1[1].ToString() + "." + r2.VideoIP1[2].ToString() + "." + r2.VideoIP1[3].ToString();
            if (strIP1 != strIP2)
            {
                sb.Append(string.Format("摄像头1IP地址: {0}改为{1}\r\n", strIP1, strIP2));
            }

            u1 = BitConverter.ToUInt16(r1.VideoPort1.Reverse<byte>().ToArray(), 0);
            u2 = BitConverter.ToUInt16(r2.VideoPort1.Reverse<byte>().ToArray(), 0);
            if (u1 != u2)
            {
                sb.Append(string.Format("摄像头1端口: {0}改为{1}\r\n", u1, u2));
            }

            str1 = new string(r1.VideoUserName1).Replace("\0", "");
            str2 = new string(r2.VideoUserName1).Replace("\0", "");
            if (str1 != str2)
            {
                sb.Append(string.Format("摄像头1用户名: {0}改为{1}\r\n", str1, str2));
            }

            str1 = new string(r1.VideoPassWord1).Replace("\0", "");
            str2 = new string(r2.VideoPassWord1).Replace("\0", "");
            if (str1 != str2)
            {
                sb.Append(string.Format("摄像头1密码: {0}改为{1}\r\n", str1, str2));
            }
          
            if (r1.VideoContentSelection1[0] != r2.VideoContentSelection1[0])
            {
                sb.Append(string.Format("摄像头1第一行叠加内容: {0}改为{1}\r\n", Common.VideoContentSelection[r1.VideoContentSelection1[0]], Common.VideoContentSelection[r2.VideoContentSelection1[0]]));
            }

            str1 = System.Text.Encoding.Default.GetString(r1.VideoOverlayName11).Replace("\0", "");
            str2 = System.Text.Encoding.Default.GetString(r2.VideoOverlayName11).Replace("\0", "");
            if (str1 != str2)
            {
                sb.Append(string.Format("摄像头1第一行自定义叠加内容: {0}改为{1}\r\n", str1, str2));
            }

            u1 = BitConverter.ToUInt16(r1.VideoContentCoordinate11_X.Reverse<byte>().ToArray(), 0);
            u2 = BitConverter.ToUInt16(r2.VideoContentCoordinate11_X.Reverse<byte>().ToArray(), 0);
            if (u1 != u2)
            {
                sb.Append(string.Format("摄像头1第一行X坐标: {0}改为{1}\r\n", u1, u2));
            }

            u1 = BitConverter.ToUInt16(r1.VideoContentCoordinate11_Y.Reverse<byte>().ToArray(), 0);
            u2 = BitConverter.ToUInt16(r2.VideoContentCoordinate11_Y.Reverse<byte>().ToArray(), 0);
            if (u1 != u2)
            {
                sb.Append(string.Format("摄像头1第一行Y坐标: {0}改为{1}\r\n", u1, u2));
            }

            if (r1.VideoContentSelection1[1] != r2.VideoContentSelection1[1])
            {
                sb.Append(string.Format("摄像头1第二行叠加内容: {0}改为{1}\r\n", Common.VideoContentSelection[r1.VideoContentSelection1[1]], Common.VideoContentSelection[r2.VideoContentSelection1[1]]));
            }

            str1 = System.Text.Encoding.Default.GetString(r1.VideoOverlayName12).Replace("\0", "");
            str2 = System.Text.Encoding.Default.GetString(r2.VideoOverlayName12).Replace("\0", "");
            if (str1 != str2)
            {
                sb.Append(string.Format("摄像头1第二行自定义叠加内容: {0}改为{1}\r\n", str1, str2));
            }

            u1 = BitConverter.ToUInt16(r1.VideoContentCoordinate12_X.Reverse<byte>().ToArray(), 0);
            u2 = BitConverter.ToUInt16(r2.VideoContentCoordinate12_X.Reverse<byte>().ToArray(), 0);
            if (u1 != u2)
            {
                sb.Append(string.Format("摄像头1第二行X坐标: {0}改为{1}\r\n", u1, u2));
            }

            u1 = BitConverter.ToUInt16(r1.VideoContentCoordinate12_Y.Reverse<byte>().ToArray(), 0);
            u2 = BitConverter.ToUInt16(r2.VideoContentCoordinate12_Y.Reverse<byte>().ToArray(), 0);
            if (u1 != u2)
            {
                sb.Append(string.Format("摄像头1第二行Y坐标: {0}改为{1}\r\n", u1, u2));
            }

            if (r1.VideoContentSelection1[2] != r2.VideoContentSelection1[2])
            {
                sb.Append(string.Format("摄像头1第三行叠加内容: {0}改为{1}\r\n", Common.VideoContentSelection[r1.VideoContentSelection1[2]], Common.VideoContentSelection[r2.VideoContentSelection1[2]]));
            }

            str1 = System.Text.Encoding.Default.GetString(r1.VideoOverlayName13).Replace("\0", "");
            str2 = System.Text.Encoding.Default.GetString(r2.VideoOverlayName13).Replace("\0", "");
            if (str1 != str2)
            {
                sb.Append(string.Format("摄像头1第三行自定义叠加内容: {0}改为{1}\r\n", str1, str2));
            }

            u1 = BitConverter.ToUInt16(r1.VideoContentCoordinate13_X.Reverse<byte>().ToArray(), 0);
            u2 = BitConverter.ToUInt16(r2.VideoContentCoordinate13_X.Reverse<byte>().ToArray(), 0);
            if (u1 != u2)
            {
                sb.Append(string.Format("摄像头1第三行X坐标: {0}改为{1}\r\n", u1, u2));
            }

            u1 = BitConverter.ToUInt16(r1.VideoContentCoordinate13_Y.Reverse<byte>().ToArray(), 0);
            u2 = BitConverter.ToUInt16(r2.VideoContentCoordinate13_Y.Reverse<byte>().ToArray(), 0);
            if (u1 != u2)
            {
                sb.Append(string.Format("摄像头1第三行Y坐标: {0}改为{1}\r\n", u1, u2));
            }

            if (r1.VideoContentSelection1[3] != r2.VideoContentSelection1[3])
            {
                sb.Append(string.Format("摄像头1第四行叠加内容: {0}改为{1}\r\n", Common.VideoContentSelection[r1.VideoContentSelection1[3]], Common.VideoContentSelection[r2.VideoContentSelection1[3]]));
            }

            str1 = System.Text.Encoding.Default.GetString(r1.VideoOverlayName14).Replace("\0", "");
            str2 = System.Text.Encoding.Default.GetString(r2.VideoOverlayName14).Replace("\0", "");
            if (str1 != str2)
            {
                sb.Append(string.Format("摄像头1第四行自定义叠加内容: {0}改为{1}\r\n", str1, str2));
            }

            u1 = BitConverter.ToUInt16(r1.VideoContentCoordinate14_X.Reverse<byte>().ToArray(), 0);
            u2 = BitConverter.ToUInt16(r2.VideoContentCoordinate14_X.Reverse<byte>().ToArray(), 0);
            if (u1 != u2)
            {
                sb.Append(string.Format("摄像头1第四行X坐标: {0}改为{1}\r\n", u1, u2));
            }

            u1 = BitConverter.ToUInt16(r1.VideoContentCoordinate14_Y.Reverse<byte>().ToArray(), 0);
            u2 = BitConverter.ToUInt16(r2.VideoContentCoordinate14_Y.Reverse<byte>().ToArray(), 0);
            if (u1 != u2)
            {
                sb.Append(string.Format("摄像头1第四行Y坐标: {0}改为{1}\r\n", u1, u2));
            }

            if (r1.VideoOverlayUpdateTime[1] != r2.VideoOverlayUpdateTime[1])
            {
                sb.Append(string.Format("摄像头2视频叠加更新时间: {0}改为{1}\r\n", r1.VideoOverlayUpdateTime[1], r2.VideoOverlayUpdateTime[1]));
            }

            strIP1 = r1.VideoIP2[0].ToString() + "." + r1.VideoIP2[1].ToString() + "." + r1.VideoIP2[2].ToString() + "." + r1.VideoIP2[3].ToString();
            strIP2 = r2.VideoIP2[0].ToString() + "." + r2.VideoIP2[1].ToString() + "." + r2.VideoIP2[2].ToString() + "." + r2.VideoIP2[3].ToString();
            if (strIP1 != strIP2)
            {
                sb.Append(string.Format("摄像头2IP地址: {0}改为{1}\r\n", strIP1, strIP2));
            }

            u1 = BitConverter.ToUInt16(r1.VideoPort2.Reverse<byte>().ToArray(), 0);
            u2 = BitConverter.ToUInt16(r2.VideoPort2.Reverse<byte>().ToArray(), 0);
            if (u1 != u2)
            {
                sb.Append(string.Format("摄像头2端口: {0}改为{1}\r\n", u1, u2));
            }

            str1 = new string(r1.VideoUserName2).Replace("\0", "");
            str2 = new string(r2.VideoUserName2).Replace("\0", "");
            if (str1 != str2)
            {
                sb.Append(string.Format("摄像头2用户名: {0}改为{1}\r\n", str1, str2));
            }

            str1 = new string(r1.VideoPassWord2).Replace("\0", "");
            str2 = new string(r2.VideoPassWord2).Replace("\0", "");
            if (str1 != str2)
            {
                sb.Append(string.Format("摄像头2密码: {0}改为{1}\r\n", str1, str2));
            }

            if (r1.VideoContentSelection2[0] != r2.VideoContentSelection2[0])
            {
                sb.Append(string.Format("摄像头2第一行叠加内容: {0}改为{1}\r\n", Common.VideoContentSelection[r1.VideoContentSelection2[0]], Common.VideoContentSelection[r2.VideoContentSelection2[0]]));
            }

            str1 = System.Text.Encoding.Default.GetString(r1.VideoOverlayName21).Replace("\0", "");
            str2 = System.Text.Encoding.Default.GetString(r2.VideoOverlayName21).Replace("\0", "");
            if (str1 != str2)
            {
                sb.Append(string.Format("摄像头2第一行自定义叠加内容: {0}改为{1}\r\n", str1, str2));
            }

            u1 = BitConverter.ToUInt16(r1.VideoContentCoordinate21_X.Reverse<byte>().ToArray(), 0);
            u2 = BitConverter.ToUInt16(r2.VideoContentCoordinate21_X.Reverse<byte>().ToArray(), 0);
            if (u1 != u2)
            {
                sb.Append(string.Format("摄像头2第一行X坐标: {0}改为{1}\r\n", u1, u2));
            }

            u1 = BitConverter.ToUInt16(r1.VideoContentCoordinate21_Y.Reverse<byte>().ToArray(), 0);
            u2 = BitConverter.ToUInt16(r2.VideoContentCoordinate21_Y.Reverse<byte>().ToArray(), 0);
            if (u1 != u2)
            {
                sb.Append(string.Format("摄像头2第一行Y坐标: {0}改为{1}\r\n", u1, u2));
            }

            if (r1.VideoContentSelection2[1] != r2.VideoContentSelection2[1])
            {
                sb.Append(string.Format("摄像头2第二行叠加内容: {0}改为{1}\r\n", Common.VideoContentSelection[r1.VideoContentSelection2[1]], Common.VideoContentSelection[r2.VideoContentSelection2[1]]));
            }

            str1 = System.Text.Encoding.Default.GetString(r1.VideoOverlayName22).Replace("\0", "");
            str2 = System.Text.Encoding.Default.GetString(r2.VideoOverlayName22).Replace("\0", "");
            if (str1 != str2)
            {
                sb.Append(string.Format("摄像头2第二行自定义叠加内容: {0}改为{1}\r\n", str1, str2));
            }

            u1 = BitConverter.ToUInt16(r1.VideoContentCoordinate22_X.Reverse<byte>().ToArray(), 0);
            u2 = BitConverter.ToUInt16(r2.VideoContentCoordinate22_X.Reverse<byte>().ToArray(), 0);
            if (u1 != u2)
            {
                sb.Append(string.Format("摄像头2第二行X坐标: {0}改为{1}\r\n", u1, u2));
            }

            u1 = BitConverter.ToUInt16(r1.VideoContentCoordinate22_Y.Reverse<byte>().ToArray(), 0);
            u2 = BitConverter.ToUInt16(r2.VideoContentCoordinate22_Y.Reverse<byte>().ToArray(), 0);
            if (u1 != u2)
            {
                sb.Append(string.Format("摄像头2第二行Y坐标: {0}改为{1}\r\n", u1, u2));
            }

            if (r1.VideoContentSelection2[2] != r2.VideoContentSelection2[2])
            {
                sb.Append(string.Format("摄像头2第三行叠加内容: {0}改为{1}\r\n", Common.VideoContentSelection[r1.VideoContentSelection2[2]], Common.VideoContentSelection[r2.VideoContentSelection2[2]]));
            }

            str1 = System.Text.Encoding.Default.GetString(r1.VideoOverlayName23).Replace("\0", "");
            str2 = System.Text.Encoding.Default.GetString(r2.VideoOverlayName23).Replace("\0", "");
            if (str1 != str2)
            {
                sb.Append(string.Format("摄像头2第三行自定义叠加内容: {0}改为{1}\r\n", str1, str2));
            }

            u1 = BitConverter.ToUInt16(r1.VideoContentCoordinate23_X.Reverse<byte>().ToArray(), 0);
            u2 = BitConverter.ToUInt16(r2.VideoContentCoordinate23_X.Reverse<byte>().ToArray(), 0);
            if (u1 != u2)
            {
                sb.Append(string.Format("摄像头2第三行X坐标: {0}改为{1}\r\n", u1, u2));
            }

            u1 = BitConverter.ToUInt16(r1.VideoContentCoordinate23_Y.Reverse<byte>().ToArray(), 0);
            u2 = BitConverter.ToUInt16(r2.VideoContentCoordinate23_Y.Reverse<byte>().ToArray(), 0);
            if (u1 != u2)
            {
                sb.Append(string.Format("摄像头2第三行Y坐标: {0}改为{1}\r\n", u1, u2));
            }

            if (r1.VideoContentSelection2[3] != r2.VideoContentSelection2[3])
            {
                sb.Append(string.Format("摄像头2第四行叠加内容: {0}改为{1}\r\n", Common.VideoContentSelection[r1.VideoContentSelection2[3]], Common.VideoContentSelection[r2.VideoContentSelection2[3]]));
            }

            str1 = System.Text.Encoding.Default.GetString(r1.VideoOverlayName24).Replace("\0", "");
            str2 = System.Text.Encoding.Default.GetString(r2.VideoOverlayName24).Replace("\0", "");
            if (str1 != str2)
            {
                sb.Append(string.Format("摄像头2第四行自定义叠加内容: {0}改为{1}\r\n", str1, str2));
            }

            u1 = BitConverter.ToUInt16(r1.VideoContentCoordinate24_X.Reverse<byte>().ToArray(), 0);
            u2 = BitConverter.ToUInt16(r2.VideoContentCoordinate24_X.Reverse<byte>().ToArray(), 0);
            if (u1 != u2)
            {
                sb.Append(string.Format("摄像头2第四行X坐标: {0}改为{1}\r\n", u1, u2));
            }

            u1 = BitConverter.ToUInt16(r1.VideoContentCoordinate24_Y.Reverse<byte>().ToArray(), 0);
            u2 = BitConverter.ToUInt16(r2.VideoContentCoordinate24_Y.Reverse<byte>().ToArray(), 0);
            if (u1 != u2)
            {
                sb.Append(string.Format("摄像头2第四行Y坐标: {0}改为{1}\r\n", u1, u2));
            }

            if (r1.WaterTemperature_Enable != r2.WaterTemperature_Enable)
            {
                if (r1.WaterTemperature_Enable == 0)
                {
                    sb.Append("添加雨量计\r\n");
                }
                else
                {
                    sb.Append("删除雨量计\r\n");
                }
            }

            if (r1.WaterTemperatureAddr != r2.WaterTemperatureAddr)
            {
                sb.Append(string.Format("雨量计通信地址: {0}改为{1}\r\n", r1.WaterTemperatureAddr, r2.WaterTemperatureAddr));
            }

            if (r1.WaterTemperatureSources != r2.WaterTemperatureSources)
            {
                sb.Append(string.Format("水温数据来源: {0}改为{1}\r\n", Common.WaterTemperatureSourcesList[r1.WaterTemperatureSources], Common.WaterTemperatureSourcesList[r2.WaterTemperatureSources]));
            }

            if (r1.WaterFlowCount_Enable != r2.WaterFlowCount_Enable)
            {
                int b1 = Common.GetIntBit(r1.WaterFlowCount_Enable, 0);
                int b2 = Common.GetIntBit(r1.WaterFlowCount_Enable, 1);
                int b11 = Common.GetIntBit(r2.WaterFlowCount_Enable, 0);
                int b22 = Common.GetIntBit(r2.WaterFlowCount_Enable, 1);

                if (b1 != b11)
                {
                    if (b1 == 0)
                    {
                        sb.Append("打开流量1流量积算功能\r\n");
                    }
                    else
                    {
                        sb.Append("关闭流量1流量积算功能\r\n");
                    }
                }

                if (b2 != b22)
                {
                    if (b2 == 0)
                    {
                        sb.Append("打开流量2流量积算功能\r\n");
                    }
                    else
                    {
                        sb.Append("关闭流量2流量积算功能\r\n");
                    }
                }
            }

            if (Common.GetIntBit(r2.WaterFlowCount_Enable, 0) == 1)
            {
                if (r1.WaterFlowCountSelect[0] != r2.WaterFlowCountSelect[0])
                {
                    sb.Append(string.Format("流量1流量积算水位计算来源: {0}改为{1}\r\n", Common.FlowList1[r1.WaterFlowCountSelect[0]], Common.FlowList1[r2.WaterFlowCountSelect[0]]));
                }

                if (r1.WaterFlowSectionSelect[0] != r2.WaterFlowSectionSelect[0])
                {
                    string strValue1 = string.Empty;
                    string strValue2 = string.Empty;
                    if (r1.WaterFlowCountSelect[0] == 0)
                    {
                        strValue1 = Common.JmList1[r1.WaterFlowSectionSelect[0]].ToString();
                    }

                    if (r1.WaterFlowCountSelect[0] == 1 || r1.WaterFlowCountSelect[0] == 3)
                    {
                        strValue1 = Common.JmList2[r1.WaterFlowSectionSelect[0]].ToString();
                    }

                    if (r1.WaterFlowCountSelect[0] == 2)
                    {
                        strValue1 = Common.JmList3[r1.WaterFlowSectionSelect[0]].ToString();
                    }

                    if (r1.WaterFlowCountSelect[0] == 4)
                    {
                        strValue1 = Common.JmList4[r1.WaterFlowSectionSelect[0]].ToString();
                    }

                    if (r2.WaterFlowCountSelect[0] == 0)
                    {
                        strValue2 = Common.JmList1[r2.WaterFlowSectionSelect[0]].ToString();
                    }

                    if (r2.WaterFlowCountSelect[0] == 1 || r2.WaterFlowCountSelect[0] == 3)
                    {
                        strValue2 = Common.JmList2[r2.WaterFlowSectionSelect[0]].ToString();
                    }

                    if (r2.WaterFlowCountSelect[0] == 2)
                    {
                        strValue2 = Common.JmList3[r2.WaterFlowSectionSelect[0]].ToString();
                    }

                    if (r2.WaterFlowCountSelect[0] == 4)
                    {
                        strValue2 = Common.JmList4[r2.WaterFlowSectionSelect[0]].ToString();
                    }

                    sb.Append(string.Format("流量1流量积算流量槽断面选择: {0}改为{1}\r\n", strValue1, strValue2));
                }

                //d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowSiltationDepth1.Reverse<byte>().ToArray(), 0) / 100.0);
                //d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowSiltationDepth1.Reverse<byte>().ToArray(), 0) / 100.0);
                //if (d1 != d2)
                //{
                //    sb.Append(string.Format("流量1流量积算淤积深度: {0}改为{1}\r\n", d1,d2));
                //}

                //d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowSiltationDepth2.Reverse<byte>().ToArray(), 0) / 100.0);
                //d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowSiltationDepth2.Reverse<byte>().ToArray(), 0) / 100.0);
                //if (d1 != d2)
                //{
                //    sb.Append(string.Format("流量2流量积算淤积深度: {0}改为{1}\r\n", d1, d2));
                //}

                int intFs = r2.WaterFlowCountSelect[0];
                int intDm = r2.WaterFlowSectionSelect[0];
                if (intFs == 0)
                {
                    if (intDm == 0)
                    {
                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowParameter12.Reverse<byte>().ToArray(), 0) / 100.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowParameter12.Reverse<byte>().ToArray(), 0) / 100.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量1流量积算堰槽高度: {0}改为{1}\r\n", d1, d2));
                        }
                    }

                    if (intDm == 1)
                    {
                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowParameter11.Reverse<byte>().ToArray(), 0) / 100.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowParameter11.Reverse<byte>().ToArray(), 0) / 100.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量1流量积算堰槽宽度: {0}改为{1}\r\n", d1, d2));
                        }
                    }

                    if (intDm == 2)
                    {
                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowParameter11.Reverse<byte>().ToArray(), 0) / 100.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowParameter11.Reverse<byte>().ToArray(), 0) / 100.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量1流量积算喉道宽度: {0}改为{1}\r\n", d1, d2));
                        }

                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowParameter12.Reverse<byte>().ToArray(), 0) / 100.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowParameter12.Reverse<byte>().ToArray(), 0) / 100.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量1流量积算流量指数: {0}改为{1}\r\n", d1, d2));
                        }

                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowParameter13.Reverse<byte>().ToArray(), 0) / 100.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowParameter13.Reverse<byte>().ToArray(), 0) / 100.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量1流量积算最小水头: {0}改为{1}\r\n", d1, d2));
                        }

                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowParameter14.Reverse<byte>().ToArray(), 0) / 100.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowParameter14.Reverse<byte>().ToArray(), 0) / 100.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量1流量积算最大水头: {0}改为{1}\r\n", d1, d2));
                        }
                    }

                    if (intDm == 3)
                    {
                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowParameter11.Reverse<byte>().ToArray(), 0) / 100.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowParameter11.Reverse<byte>().ToArray(), 0) / 100.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量1流量积算喉道宽度: {0}改为{1}\r\n", d1, d2));
                        }

                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowParameter13.Reverse<byte>().ToArray(), 0) / 100.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowParameter13.Reverse<byte>().ToArray(), 0) / 100.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量1流量积算最小水头: {0}改为{1}\r\n", d1, d2));
                        }

                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowParameter14.Reverse<byte>().ToArray(), 0) / 100.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowParameter14.Reverse<byte>().ToArray(), 0) / 100.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量1流量积算最大水头: {0}改为{1}\r\n", d1, d2));
                        }
                    }

                    if (intDm == 4)
                    {
                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowParameter12.Reverse<byte>().ToArray(), 0) / 100.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowParameter12.Reverse<byte>().ToArray(), 0) / 100.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量1流量积算圆管直径: {0}改为{1}\r\n", d1, d2));
                        }
                    }

                    if (intDm == 5)
                    {
                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowParameter12.Reverse<byte>().ToArray(), 0) / 100.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowParameter12.Reverse<byte>().ToArray(), 0) / 100.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量1流量积算堰口宽度: {0}改为{1}\r\n", d1, d2));
                        }
                    }
                }

                if (intFs == 1 || intFs == 3 || intFs == 4)
                {
                    if (intDm == 0 || intDm == 1)
                    {
                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowSiltationDepth1.Reverse<byte>().ToArray(), 0) / 1000.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowSiltationDepth1.Reverse<byte>().ToArray(), 0) / 1000.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量1流量积算淤积深度: {0}改为{1}\r\n", d1, d2));
                        }

                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowParameter11.Reverse<byte>().ToArray(), 0) / 100.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowParameter11.Reverse<byte>().ToArray(), 0) / 100.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量1流量积算上底宽度: {0}改为{1}\r\n", d1, d2));
                        }

                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowParameter12.Reverse<byte>().ToArray(), 0) / 100.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowParameter12.Reverse<byte>().ToArray(), 0) / 100.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量1流量积算堰槽高度: {0}改为{1}\r\n", d1, d2));
                        }
                    }

                    if (intDm == 2)
                    {
                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowSiltationDepth1.Reverse<byte>().ToArray(), 0) / 1000.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowSiltationDepth1.Reverse<byte>().ToArray(), 0) / 1000.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量1流量积算淤积深度: {0}改为{1}\r\n", d1, d2));
                        }

                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowParameter11.Reverse<byte>().ToArray(), 0) / 100.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowParameter11.Reverse<byte>().ToArray(), 0) / 100.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量1流量积算窄底宽度: {0}改为{1}\r\n", d1, d2));
                        }

                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowParameter12.Reverse<byte>().ToArray(), 0) / 100.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowParameter12.Reverse<byte>().ToArray(), 0) / 100.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量1流量积算堰槽高度: {0}改为{1}\r\n", d1, d2));
                        }

                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowParameter13.Reverse<byte>().ToArray(), 0) / 100.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowParameter13.Reverse<byte>().ToArray(), 0) / 100.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量1流量积算宽底宽度: {0}改为{1}\r\n", d1, d2));
                        }
                    }

                    if (intDm == 3)
                    {
                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowSiltationDepth1.Reverse<byte>().ToArray(), 0) / 1000.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowSiltationDepth1.Reverse<byte>().ToArray(), 0) / 1000.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量1流量积算淤积深度: {0}改为{1}\r\n", d1, d2));
                        }

                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowParameter12.Reverse<byte>().ToArray(), 0) / 100.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowParameter12.Reverse<byte>().ToArray(), 0) / 100.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量1流量积算堰槽直径: {0}改为{1}\r\n", d1, d2));
                        }
                    }

                    if (intDm == 4)
                    {
                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowSiltationDepth1.Reverse<byte>().ToArray(), 0) / 1000.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowSiltationDepth1.Reverse<byte>().ToArray(), 0) / 1000.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量1流量积算淤积深度: {0}改为{1}\r\n", d1, d2));
                        }

                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowParameter11.Reverse<byte>().ToArray(), 0) / 100.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowParameter11.Reverse<byte>().ToArray(), 0) / 100.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量1流量积算窄底宽度: {0}改为{1}\r\n", d1, d2));
                        }


                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowParameter12.Reverse<byte>().ToArray(), 0) / 100.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowParameter12.Reverse<byte>().ToArray(), 0) / 100.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量1流量积算梯形高度: {0}改为{1}\r\n", d1, d2));
                        }

                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowParameter13.Reverse<byte>().ToArray(), 0) / 100.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowParameter13.Reverse<byte>().ToArray(), 0) / 100.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量1流量积算宽底宽度: {0}改为{1}\r\n", d1, d2));
                        }


                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowParameter14.Reverse<byte>().ToArray(), 0) / 100.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowParameter14.Reverse<byte>().ToArray(), 0) / 100.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量1流量积算圆弧深度: {0}改为{1}\r\n", d1, d2));
                        }
                    }

                    if (intDm == 5)
                    {
                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowSiltationDepth1.Reverse<byte>().ToArray(), 0) / 1000.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowSiltationDepth1.Reverse<byte>().ToArray(), 0) / 1000.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量1流量积算淤积深度: {0}改为{1}\r\n", d1, d2));
                        }

                        if (r1.WaterFlowSectionHeightResolution[0] != r2.WaterFlowSectionHeightResolution[0])
                        {
                            sb.Append(string.Format("流量1流量积算高度分辨率: {0}改为{1}\r\n", r1.WaterFlowSectionHeightResolution[0], r2.WaterFlowSectionHeightResolution[0]));
                        }
                    }
                }

                if (intFs == 2)
                {
                    if (intDm == 0)
                    {
                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowParameter11.Reverse<byte>().ToArray(), 0) / 100.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowParameter11.Reverse<byte>().ToArray(), 0) / 100.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量1流量积算闸门宽度: {0}改为{1}\r\n", d1, d2));
                        }
                    }
                }
                //}
                d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowCorrection1.Reverse<byte>().ToArray(), 0) / 1000.0);
                d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowCorrection1.Reverse<byte>().ToArray(), 0) / 1000.0);
                if (d1 != d2)
                {
                    sb.Append(string.Format("流量1流量积算流量校正: {0}改为{1}\r\n", d1, d2));
                }

                if (r1.WaterFlowShowType[0] != r2.WaterFlowShowType[0])
                {
                    sb.Append(string.Format("流量1流量积算流量显示类型: {0}改为{1}\r\n", Common.WaterFlowShowType[r1.WaterFlowShowType[0]], Common.WaterFlowShowType[r2.WaterFlowShowType[0]]));
                }

                if (r1.WaterFlowAccuracy[0] != r2.WaterFlowAccuracy[0])
                {
                    sb.Append(string.Format("流量1流量积算流量精度选择: {0}改为{1}\r\n", Common.WaterFlowAccuracy[r1.WaterFlowAccuracy[0]], Common.WaterFlowAccuracy[r2.WaterFlowAccuracy[0]]));
                }

                if (r1.WaterFlowCumulativeSwitch[0] != r2.WaterFlowCumulativeSwitch[0])
                {
                    sb.Append(string.Format("流量1流量积算累计流量开关: {0}改为{1}\r\n", Common.OpenStatus[r1.WaterFlowCumulativeSwitch[0]], Common.OpenStatus[r2.WaterFlowCumulativeSwitch[0]]));
                }

                d1 = Convert.ToDecimal(BitConverter.ToUInt32(r1.WaterFlowTotal1.Reverse<byte>().ToArray(), 0) / 100000.0);
                d2 = Convert.ToDecimal(BitConverter.ToUInt32(r2.WaterFlowTotal1.Reverse<byte>().ToArray(), 0) / 100000.0);
                if (d1 != d2)
                {
                    sb.Append(string.Format("流量1流量积算累计流量: {0}改为{1}\r\n", d1, d2));
                }

                if (r1.WaterFlowTwoway[0] != r2.WaterFlowTwoway[0])
                {
                    sb.Append(string.Format("流量1流量积算累计流量开关: {0}改为{1}\r\n", Common.OpenStatus[r1.WaterFlowTwoway[0]], Common.OpenStatus[r2.WaterFlowTwoway[0]]));
                }

                if (r1.WaterFlowWaveFiltering[0] != r2.WaterFlowWaveFiltering[0])
                {
                    sb.Append(string.Format("流量1流量积算流量滤波: {0}改为{1}\r\n", r1.WaterFlowWaveFiltering[0], r2.WaterFlowWaveFiltering[0]));
                }
            }

            if (Common.GetIntBit(r2.WaterFlowCount_Enable, 1) == 1)
            {
                if (r1.WaterFlowCountSelect[1] != r2.WaterFlowCountSelect[1])
                {
                    sb.Append(string.Format("流量2流量积算水位计算来源: {0}改为{1}\r\n", Common.FlowList2[r1.WaterFlowCountSelect[1]], Common.FlowList2[r2.WaterFlowCountSelect[1]]));
                }

                if (r1.WaterFlowSectionSelect[1] != r2.WaterFlowSectionSelect[1])
                {
                    string strValue1 = string.Empty;
                    string strValue2 = string.Empty;
                    if (r1.WaterFlowCountSelect[1] == 0)
                    {
                        strValue1 = Common.JmList1[r1.WaterFlowSectionSelect[1]].ToString();
                    }

                    if (r1.WaterFlowCountSelect[1] == 1 || r1.WaterFlowCountSelect[1] == 3)
                    {
                        strValue1 = Common.JmList2[r1.WaterFlowSectionSelect[1]].ToString();
                    }

                    if (r1.WaterFlowCountSelect[1] == 2)
                    {
                        strValue1 = Common.JmList3[r1.WaterFlowSectionSelect[1]].ToString();
                    }

                    if (r1.WaterFlowCountSelect[1] == 4)
                    {
                        strValue1 = Common.JmList4[r1.WaterFlowSectionSelect[1]].ToString();
                    }

                    if (r2.WaterFlowCountSelect[1] == 0)
                    {
                        strValue2 = Common.JmList1[r2.WaterFlowSectionSelect[1]].ToString();
                    }

                    if (r2.WaterFlowCountSelect[1] == 1 || r2.WaterFlowCountSelect[1] == 3)
                    {
                        strValue2 = Common.JmList2[r2.WaterFlowSectionSelect[1]].ToString();
                    }

                    if (r2.WaterFlowCountSelect[1] == 2)
                    {
                        strValue2 = Common.JmList3[r2.WaterFlowSectionSelect[1]].ToString();
                    }

                    if (r2.WaterFlowCountSelect[1] == 4)
                    {
                        strValue2 = Common.JmList4[r2.WaterFlowSectionSelect[1]].ToString();
                    }

                    sb.Append(string.Format("流量2流量积算流量槽断面选择: {0}改为{1}\r\n", strValue1, strValue2));
                }

                //if (r1.WaterFlowCountSelect[1] != r2.WaterFlowCountSelect[1] && r1.WaterFlowSectionSelect[1] != r2.WaterFlowSectionSelect[1])
                //{
                int intFs = r2.WaterFlowCountSelect[1];
                int intDm = r2.WaterFlowSectionSelect[1];
                if (intFs == 0)
                {
                    if (intDm == 0)
                    {
                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowParameter22.Reverse<byte>().ToArray(), 0) / 100.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowParameter22.Reverse<byte>().ToArray(), 0) / 100.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量2流量积算堰槽高度: {0}改为{1}\r\n", d1, d2));
                        }
                    }

                    if (intDm == 1)
                    {
                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowParameter21.Reverse<byte>().ToArray(), 0) / 100.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowParameter21.Reverse<byte>().ToArray(), 0) / 100.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量2流量积算堰槽宽度: {0}改为{1}\r\n", d1, d2));
                        }
                    }

                    if (intDm == 2)
                    {
                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowParameter21.Reverse<byte>().ToArray(), 0) / 100.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowParameter21.Reverse<byte>().ToArray(), 0) / 100.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量2流量积算喉道宽度: {0}改为{1}\r\n", d1, d2));
                        }

                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowParameter22.Reverse<byte>().ToArray(), 0) / 100.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowParameter22.Reverse<byte>().ToArray(), 0) / 100.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量2流量积算流量指数: {0}改为{1}\r\n", d1, d2));
                        }

                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowParameter23.Reverse<byte>().ToArray(), 0) / 100.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowParameter23.Reverse<byte>().ToArray(), 0) / 100.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量2流量积算最小水头: {0}改为{1}\r\n", d1, d2));
                        }

                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowParameter24.Reverse<byte>().ToArray(), 0) / 100.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowParameter24.Reverse<byte>().ToArray(), 0) / 100.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量2流量积算最大水头: {0}改为{1}\r\n", d1, d2));
                        }
                    }

                    if (intDm == 3)
                    {
                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowParameter21.Reverse<byte>().ToArray(), 0) / 100.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowParameter21.Reverse<byte>().ToArray(), 0) / 100.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量2流量积算喉道宽度: {0}改为{1}\r\n", d1, d2));
                        }

                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowParameter23.Reverse<byte>().ToArray(), 0) / 100.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowParameter23.Reverse<byte>().ToArray(), 0) / 100.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量2流量积算最小水头: {0}改为{1}\r\n", d1, d2));
                        }

                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowParameter24.Reverse<byte>().ToArray(), 0) / 100.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowParameter24.Reverse<byte>().ToArray(), 0) / 100.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量2流量积算最大水头: {0}改为{1}\r\n", d1, d2));
                        }
                    }

                    if (intDm == 4)
                    {
                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowParameter22.Reverse<byte>().ToArray(), 0) / 100.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowParameter22.Reverse<byte>().ToArray(), 0) / 100.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量2流量积算圆管直径: {0}改为{1}\r\n", d1, d2));
                        }
                    }

                    if (intDm == 5)
                    {
                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowParameter22.Reverse<byte>().ToArray(), 0) / 100.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowParameter22.Reverse<byte>().ToArray(), 0) / 100.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量2流量积算堰口宽度: {0}改为{1}\r\n", d1, d2));
                        }
                    }
                }

                if (intFs == 1 || intFs == 3 || intFs == 4)
                {
                    if (intDm == 0 || intDm == 1)
                    {
                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowSiltationDepth2.Reverse<byte>().ToArray(), 0) / 1000.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowSiltationDepth2.Reverse<byte>().ToArray(), 0) / 1000.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量2流量积算淤积深度: {0}改为{1}\r\n", d1, d2));
                        }

                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowParameter21.Reverse<byte>().ToArray(), 0) / 100.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowParameter21.Reverse<byte>().ToArray(), 0) / 100.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量2流量积算上底宽度: {0}改为{1}\r\n", d1, d2));
                        }

                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowParameter22.Reverse<byte>().ToArray(), 0) / 100.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowParameter22.Reverse<byte>().ToArray(), 0) / 100.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量2流量积算堰槽高度: {0}改为{1}\r\n", d1, d2));
                        }
                    }

                    if (intDm == 2)
                    {
                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowSiltationDepth2.Reverse<byte>().ToArray(), 0) / 1000.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowSiltationDepth2.Reverse<byte>().ToArray(), 0) / 1000.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量2流量积算淤积深度: {0}改为{1}\r\n", d1, d2));
                        }

                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowParameter21.Reverse<byte>().ToArray(), 0) / 100.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowParameter21.Reverse<byte>().ToArray(), 0) / 100.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量2流量积算窄底宽度: {0}改为{1}\r\n", d1, d2));
                        }

                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowParameter22.Reverse<byte>().ToArray(), 0) / 100.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowParameter22.Reverse<byte>().ToArray(), 0) / 100.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量2流量积算堰槽高度: {0}改为{1}\r\n", d1, d2));
                        }

                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowParameter23.Reverse<byte>().ToArray(), 0) / 100.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowParameter23.Reverse<byte>().ToArray(), 0) / 100.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量2流量积算宽底宽度: {0}改为{1}\r\n", d1, d2));
                        }
                    }

                    if (intDm == 3)
                    {
                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowSiltationDepth2.Reverse<byte>().ToArray(), 0) / 1000.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowSiltationDepth2.Reverse<byte>().ToArray(), 0) / 1000.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量2流量积算淤积深度: {0}改为{1}\r\n", d1, d2));
                        }

                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowParameter22.Reverse<byte>().ToArray(), 0) / 100.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowParameter22.Reverse<byte>().ToArray(), 0) / 100.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量2流量积算堰槽直径: {0}改为{1}\r\n", d1, d2));
                        }
                    }

                    if (intDm == 4)
                    {
                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowSiltationDepth2.Reverse<byte>().ToArray(), 0) / 1000.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowSiltationDepth2.Reverse<byte>().ToArray(), 0) / 1000.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量2流量积算淤积深度: {0}改为{1}\r\n", d1, d2));
                        }

                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowParameter21.Reverse<byte>().ToArray(), 0) / 100.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowParameter21.Reverse<byte>().ToArray(), 0) / 100.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量2流量积算窄底宽度: {0}改为{1}\r\n", d1, d2));
                        }


                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowParameter22.Reverse<byte>().ToArray(), 0) / 100.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowParameter22.Reverse<byte>().ToArray(), 0) / 100.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量2流量积算梯形高度: {0}改为{1}\r\n", d1, d2));
                        }

                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowParameter23.Reverse<byte>().ToArray(), 0) / 100.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowParameter23.Reverse<byte>().ToArray(), 0) / 100.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量2流量积算宽底宽度: {0}改为{1}\r\n", d1, d2));
                        }


                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowParameter24.Reverse<byte>().ToArray(), 0) / 100.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowParameter24.Reverse<byte>().ToArray(), 0) / 100.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量2流量积算圆弧深度: {0}改为{1}\r\n", d1, d2));
                        }
                    }

                    if (intDm == 5)
                    {
                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowSiltationDepth2.Reverse<byte>().ToArray(), 0) / 1000.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowSiltationDepth2.Reverse<byte>().ToArray(), 0) / 1000.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量2流量积算淤积深度: {0}改为{1}\r\n", d1, d2));
                        }

                        if (r1.WaterFlowSectionHeightResolution[1] != r2.WaterFlowSectionHeightResolution[1])
                        {
                            sb.Append(string.Format("流量2流量积算高度分辨率: {0}改为{1}\r\n", r1.WaterFlowSectionHeightResolution[1], r2.WaterFlowSectionHeightResolution[1]));
                        }
                    }
                }

                if (intFs == 2)
                {
                    if (intDm == 0)
                    {
                        d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowParameter21.Reverse<byte>().ToArray(), 0) / 100.0);
                        d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowParameter21.Reverse<byte>().ToArray(), 0) / 100.0);
                        if (d1 != d2)
                        {
                            sb.Append(string.Format("流量2流量积算闸门宽度: {0}改为{1}\r\n", d1, d2));
                        }
                    }
                }
                //}

                d1 = Convert.ToDecimal(BitConverter.ToUInt16(r1.WaterFlowCorrection2.Reverse<byte>().ToArray(), 0) / 1000.0);
                d2 = Convert.ToDecimal(BitConverter.ToUInt16(r2.WaterFlowCorrection2.Reverse<byte>().ToArray(), 0) / 1000.0);
                if (d1 != d2)
                {
                    sb.Append(string.Format("流量2流量积算流量校正: {0}改为{1}\r\n", d1, d2));
                }

                if (r1.WaterFlowShowType[1] != r2.WaterFlowShowType[1])
                {
                    sb.Append(string.Format("流量2流量积算流量显示类型: {0}改为{1}\r\n", Common.WaterFlowShowType[r1.WaterFlowShowType[1]], Common.WaterFlowShowType[r2.WaterFlowShowType[1]]));
                }

                if (r1.WaterFlowAccuracy[1] != r2.WaterFlowAccuracy[1])
                {
                    sb.Append(string.Format("流量2流量积算流量精度选择: {0}改为{1}\r\n", Common.WaterFlowAccuracy[r1.WaterFlowAccuracy[1]], Common.WaterFlowAccuracy[r2.WaterFlowAccuracy[1]]));
                }

                if (r1.WaterFlowCumulativeSwitch[1] != r2.WaterFlowCumulativeSwitch[1])
                {
                    sb.Append(string.Format("流量2流量积算累计流量开关: {0}改为{1}\r\n", Common.OpenStatus[r1.WaterFlowCumulativeSwitch[1]], Common.OpenStatus[r2.WaterFlowCumulativeSwitch[1]]));
                }

                d1 = Convert.ToDecimal(BitConverter.ToUInt32(r1.WaterFlowTotal2.Reverse<byte>().ToArray(), 0) / 100000.0);
                d2 = Convert.ToDecimal(BitConverter.ToUInt32(r2.WaterFlowTotal2.Reverse<byte>().ToArray(), 0) / 100000.0);
                if (d1 != d2)
                {
                    sb.Append(string.Format("流量2流量积算累计流量: {0}改为{1}\r\n", d1, d2));
                }

                if (r1.WaterFlowTwoway[1] != r2.WaterFlowTwoway[1])
                {
                    sb.Append(string.Format("流量2流量积算累计流量开关: {0}改为{1}\r\n", Common.OpenStatus[r1.WaterFlowTwoway[1]], Common.OpenStatus[r2.WaterFlowTwoway[1]]));
                }

                if (r1.WaterFlowWaveFiltering[1] != r2.WaterFlowWaveFiltering[1])
                {
                    sb.Append(string.Format("流量2流量积算流量滤波: {0}改为{1}\r\n", r1.WaterFlowWaveFiltering[1], r2.WaterFlowWaveFiltering[1]));
                }
            }
            return sb.ToString();
        }
    }
}
